SKY-D375 · CI/CD pipelines
Pull request changes a job that publishes packages
A review flag for pull requests. When a change adds a CI job that publishes packages, or changes what such a job does (its triggers, permissions, secrets, actions, installed tools or publish commands), SKY-D375 points at the job so a person reviews it before it merges.
- Languages
- GitHub Actions workflows, GitLab CI
- Quality gate
- Full scan: not checked. Diff scan: counted toward the gate limits. It runs only when the scan compares against a base (
--diff), and counts towardmax_security. A check that could not run, such as a missing or failingca9, is an analysis error, so a diff gate stops as incomplete instead of passing. - Finding type
- review
Why it matters
A publish job holds the keys to your package. A small, friendly-looking edit to it, such as a new permission, a new action or a changed trigger, can let later runs publish code nobody reviewed, and the edit is easy to miss among other workflow changes.
What Skylos flags
name: Releaseon: push: tags: ["v*"]permissions: contents: readjobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 with: persist-credentials: false - run: npm ci - run: npm test publish: needs: test runs-on: ubuntu-latest environment: npmAdded: permissions:Added: contents: readAdded: id-token: write steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 with: persist-credentials: false - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: node-version: 22 registry-url: https://registry.npmjs.org - run: npm ciRemoved: - run: npm publish --access publicAdded: - run: npm publish --provenance --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}What Skylos leaves alone
name: Releaseon: push: tags: ["v*"]permissions: contents: readjobs: test: runs-on: ubuntu-latestAdded: strategy:Added: matrix:Added: node: [20, 22, 24] steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 with: persist-credentials: falseAdded: - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020Added: with:Added: node-version: ${{ matrix.node }} - run: npm ci - run: npm test publish: needs: test runs-on: ubuntu-latest environment: npm steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 with: persist-credentials: false - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: node-version: 22 registry-url: https://registry.npmjs.org - run: npm ci - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}Why Skylos leaves it alone
The pull request edits the release workflow, but only its test job, which publishes nothing. The publish job is the same as before, even though its lines moved down.
How Skylos decides
- Runs only in a diff scan with
--dangeror-a(skylos . --danger --diff origin/main), and in the pull-request scans Skylos uploads from CI. It compares the merge base with the working tree. - Looks only when a Git-tracked CI file changed: a
*.ymlor*.yamldirectly in.github/workflows, another YAML file under.github(outside.github/workflows) or.gitlab, or a top-level.gitlab-ci.yml. Untracked files never count. - The
ca9library builds an inventory of both sides (ci_inventory) and keeps the jobs that publish: a publish command, a publish action or a publish credential. - Compares each publish job with the base's job of the same file and name, with line numbers removed: runner, environment, permissions, secret names, actions and their refs, installs, tools, downloads, publish commands, and the workflow's triggers and branch filters.
- Reports one MEDIUM finding per publish job that is new or whose inventory changed, on the job's name, whatever lines the diff touched.
How to fix it
There is nothing to change in the code: read every changed step, trigger and permission of the publish job, and merge only when you would run that job yourself. Once merged, the job matches the base and is no longer reported. Keeping publish jobs small and in their own workflow file makes these reviews short.
When it can be wrong
- Any change to the workflow's triggers marks every publish job in it as changed, even when the new trigger cannot reach the publish job.
- Missed: a changed shell line the inventory does not model, such as a new
npm run buildorechostep in the publish job, is not seen as a change.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Skylos reads no inline marker for this rule; a
# skylos: ignorecomment on the job does not hide it.[tool.skylos] ignore = ["SKY-D375"]turns the rule off for the whole project. There is nothing to baseline: the finding disappears once the change is merged.