Skip to main content

SKY-D375 · CI/CD pipelines

Pull request changes a job that publishes packages

Medium

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 toward max_security. A check that could not run, such as a missing or failing ca9, is an analysis error, so a diff gate stops as incomplete instead of passing.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

.github/workflows/release.yml · YAML · changed
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

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

.github/workflows/release.yml · YAML · changed
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

  1. Runs only in a diff scan with --danger or -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.
  2. Looks only when a Git-tracked CI file changed: a *.yml or *.yaml directly in .github/workflows, another YAML file under .github (outside .github/workflows) or .gitlab, or a top-level .gitlab-ci.yml. Untracked files never count.
  3. The ca9 library builds an inventory of both sides (ci_inventory) and keeps the jobs that publish: a publish command, a publish action or a publish credential.
  4. 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.
  5. 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 build or echo step 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: ignore comment 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.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.