[MAINT] Github Actions Reunification - `sansec-ecomscan`

未关闭
#333 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@damienwebdev 已经在做这个了。

开始于 2026年5月6日。

评估

这个 Issue 还没有评估数据。

描述

Action: sansec-ecomscan (new)

Status: 🔴 Convert workflow → action
Source: .github/workflows/sansec-ecomscan.yml (mage-os-only)
Target: sansec-ecomscan/action.yml + .github/workflows/sansec-ecomscan.yml (thin caller)


What the workflow currently does

  1. Checks out the repo (actions/checkout@v5, persist-credentials: false, PR head SHA)
  2. Downloads the ecomscan binary from https://ecomscan.com/downloads/linux-amd64/ecomscan
  3. chmod +x ecomscan
  4. Runs ./ecomscan --no-auto-update --skip-database --deep --format=csv . with ECOMSCAN_KEY env var
  5. Fails (exit 1) if any output is produced

Dependents

No external repos call this workflow (per dependents.md). It is only used internally by mage-os/github-actions itself. This makes the conversion low risk.


Design decisions

  • Checkout stays in the caller workflow — consistent with the pattern used by other actions in this repo (setup-magento, coding-standard post-refactor, etc.)
  • License key passed as an input — composite actions cannot read secrets directly; callers must pass the value explicitly
  • persist-credentials: false and ref handling — these checkout options are caller concerns and stay in the workflow
  • pull_request_target trigger and the push-on-PR skip guard — these are workflow-level concerns and stay in the caller

New action: sansec-ecomscan/action.yml

Inputs
Input Required Description
ecomscan_key true Sansec license key (ECOMSCAN_KEY)
Steps
  1. Download ecomscan binary
  2. chmod +x ecomscan
  3. Run ecomscan, fail on output

Updated workflow: .github/workflows/sansec-ecomscan.yml

Becomes a thin caller that handles checkout and trigger logic, then delegates to the action:

on:
  push:
  pull_request_target:
  workflow_dispatch:

jobs:
  run-ecomscan:
    if: github.event.pull_request == null || github.event_name != 'push'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
    steps:
      - uses: actions/checkout@v6
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          persist-credentials: false

      - uses: mage-os/github-actions/sansec-ecomscan@main
        with:
          ecomscan_key: ${{ secrets.SANSEC_LICENSE_KEY }}

Implementation steps

  1. Create sansec-ecomscan/action.yml as a composite action with the download/chmod/run steps and an ecomscan_key input
  2. Update .github/workflows/sansec-ecomscan.yml to the thin caller above
  3. Bump actions/checkout from v5 to v6 in the workflow
主要语言
TypeScript
星标
12
派生
15
平均合并
3 天 15 小时
30 天内合并 PR
5

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mage-os/github-actions 的其他 Issue

查看 mage-os/github-actions 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。