ci(deploy): post a legacy "CI" commit status after deploy#12
Merged
Conversation
PR-management UIs that read the older GitHub *Statuses* API (rather than the newer *Check Runs* API) currently show every merge commit on main as stuck-on-`pending`. The check-runs themselves are all green — Build & Deploy, CodeQL, Secret Scanning — but nothing posts a classic commit status, so the combined `state` reported by `/repos/.../commits/:sha/status` is `pending`. This step calls the Statuses API at the end of the deploy job to post `context: CI, state: success|failure` based on `job.status`. Runs with `if: always()` so a failed deploy also gets a status posted (red instead of leaving it pending forever). Adds `statuses: write` to the workflow permissions (was `contents: read` only). No other side-effects. Signed-off-by: Musiker15 <info@musiker15.de>
Dependency ReviewThe following issues were found:
License Issues.github/workflows/deploy.yml
OpenSSF Scorecard
Scanned Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR-management UIs that read the older Statuses API show every merge commit on
mainas stuck-on-pending. The Check Runs (Build & Deploy / CodeQL / Secret Scanning) are all green — but nothing posts a classic commit status, so:gh api repos/MSK-Scripts/documentation/commits/main/status -q .state # → "pending"even though:
Change
After the deploy step, post
context: CIto the Statuses API withstatederived fromjob.status. Runs withif: always()so a failed deploy also gets a status posted (red instead of leaving it stuck on pending forever).Adds
statuses: writeto the workflow permissions (wascontents: readonly).Why only this repo
Only the
documentationrepo is doing this —mskanbanhas the same combined-statuspendingbut the UI in question only surfaces this for documentation PRs (see MSKanban PR #56 conversation). If we ever hit the same with mskanban, this is a copy-paste fix.Test plan
CIstatus;gh api repos/.../commits/main/status -q .stateflips frompendingtosuccess