Skip to content

fix(ci): guard npm-publish job to skip unrelated PR comments - #836

Closed
jinglongchenTS wants to merge 1 commit into
Tradeshift:masterfrom
jinglongchenTS:fix/npm-publish-guard-comment
Closed

fix(ci): guard npm-publish job to skip unrelated PR comments#836
jinglongchenTS wants to merge 1 commit into
Tradeshift:masterfrom
jinglongchenTS:fix/npm-publish-guard-comment

Conversation

@jinglongchenTS

Copy link
Copy Markdown
Contributor

Summary

  • Investigated the failed check at https://github.com/Tradeshift/elements/runs/95983990682 (actions-autoscaler, conclusion action_required: "self-hosted runners are not available on public repositories").
  • Root cause: .github/workflows/npm-publish.yml listens to every issue_comment on a PR with no top-level filter. The reusable workflow it calls (tradeshift/actions-workflow-npm/.github/workflows/comment-npm-publish.yml@v1) hardcodes runs-on: [self-hosted, ts-large-x64-docker-large] and only skips via an internal job if: (comment body must be exactly npm publish from an OWNER/MEMBER). In this case a ts-sonarqube[bot] quality-gate comment on PR chore(deps): update dependency postcss to ^8.5.26 #835 triggered it. Since elements is a public repo, the org's actions-autoscaler policy blocks self-hosted runners here and cancels the job at queue time — before the internal if: can skip it — surfacing as a spurious failed check on unrelated comments.
  • Fix: move the same guard to the calling job in this repo's workflow, so the reusable workflow (and its self-hosted-runner job) is never queued for comments that don't match, avoiding the autoscaler false-positive entirely.

Test plan

  • Comment something unrelated (e.g. a normal review comment) on a PR and confirm no npm-publish check is queued/red.
  • Comment npm publish on a PR as an org member and confirm the publish job still runs as before.

Any comment on a PR (including automated bot comments) was queuing the
self-hosted npm-publish job before its internal if-condition could skip
it. Since elements is a public repo, the org's actions-autoscaler policy
blocks self-hosted runners here and cancels the queued job with
action_required, showing as a spurious failed check. Move the guard to
the calling job so unrelated comments never queue it in the first place.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jinglongchenTS
jinglongchenTS requested review from a team as code owners August 19, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant