← Back to Pull requests

ci: open update-releases PRs with the release GitHub App token #242

Closed
unknown closed this pull request without merging on Nov 29, 2026 18:20 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 17:03 UTC
Author

Opens the update-releases PRs with the oras-project-release-bot App token, so CI starts on them by itself, and keeps the App key away from npm ci. It also fixes the input injection from #237, as #238 proposes.

Closes #237
Closes #238

Changes

.github/workflows/update-releases.yml is split into two jobs, and the top-level permissions: is now {}:

  • update: no Environment, contents: read, checkout with persist-credentials: false.

  • - Runs npm ci, the update script and npm run build, as before.
    - inputs.version now reaches the script as $INPUT_VERSION through env: (#237).
    - When either output is set, it stages everything with git add -A and uploads git diff --cached --binary as the changes artifact (1-day retention). Staging first means files that are new in dist/ are included, and deleted files are removed. .gitignored build output is left out.
    - ADDED_VERSIONS and DEFAULT_VERSION become job outputs.
  • pr: needs: update, runs only when either output is non-empty, environment: release, permissions: {}.

  • - Checks out with persist-credentials: false, downloads the artifact and runs git apply. No npm runs in this job.
    - Mints the token with actions/create-github-app-token, pinned to the same SHA oras-go uses (f418cff…, v3.4.0), with repositories: setup-oras, permission-contents: write and permission-pull-requests: write.
    - Runs create-pull-request with that token and an explicit author/committer. commit-message, title and body now read needs.update.outputs.*; the rest (sign-commits, signoff, branch, body text) is unchanged.

    RELEASING.md gains a paragraph on the two jobs under "Automatic patch releases", and a "GitHub App" section next to "Deploy key". It covers what the App can do here, that RELEASE_APP_ID/RELEASE_APP_KEY live only in the main-only release Environment, that the App isn't a release-tags bypass actor, and that an org owner rotates the key.

    Two changes from the issue's sketch:

  • Bot identity is looked up, not hardcoded. The author/committer identity is built from the token action's app-slug output and GET /users/{slug}[bot], instead of the literal oras-project-release-bot[bot] <362079208+…>. Upstream it resolves to that same value. It also keeps Signed-off-by matching the commit's real author if the App is ever replaced, and it let me test DCO on a fork with a different App.

  • The pr job checks out the run's commit, as update does, rather than naming main explicitly. The release Environment only deploys from main, so that commit is on main and the patch applies to the exact tree it was made from.
  • Testing

    I tested on my fork yashwanthkumarsuruneni/setup-oras:

  • a test App with contents: write and pull_requests: write

  • a release Environment whose deployment branches are main only

  • "Allow GitHub Actions to create and approve pull requests" off
  • To give the workflow something to add, fork main had one extra fork-only commit that drops CLI 1.4.0 from releases.json and sets the action.yml default back to 1.3.6.

    | Done-when item | Result |
    |---|---|
    | Dispatch from main opens a PR authored by the bot | run → PR #2 by oras-release-test-5f939a[bot]: adds 1.4.0 back and bumps the default to 1.4.0 |
    | Its commit shows as Verified | verified: true (valid); Signed-off-by matches the commit author (the App bot) |
    | CI starts without anyone triggering it | Tests, Check dist/ and License Checker started on the PR with the bot as actor; Tests and Check dist/ passed (DCO isn't installed on my fork, so I checked the sign-off by hand as above) |
    | Dispatch from another branch fails at the Environment gate | run: update ran, pr refused with Branch "gate-test" is not allowed to deploy to release due to environment protection rules |

    actionlint (with shellcheck) passes on the workflow.

    Not covered: a run where the rebuild changes dist/. My fork-only commit didn't rebuild dist/, so the rebuilt bundle was identical and the patch only touched releases.json and action.yml. The patch handling is the same either way. The first real CLI release after this merges will exercise it, and check-dist will catch any mismatch.

    After this merges, #240 can turn off "Allow GitHub Actions to create and approve pull requests".

    Diff: 576 lines (+432 / -144) across 7 files Reviewer: TerryHowe Review duration: 76m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.73) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.73 · 576 lines diff across 7 files
    0.73
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.380
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.073
    Real PR Conversation Timeline
    1 comments
    "Review active on #242"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 73% (HIGH) · Higher = larger blast radius
    73%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.7% · Safe to merge
    30.7%