Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:

- run: pnpm install --frozen-lockfile

# Generate GitHub App token to allow version PR to trigger CI workflows
# (GITHUB_TOKEN cannot trigger workflows by design)
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
Comment on lines 37 to 44
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

actions/create-github-app-token latest version releases GitHub Actions

💡 Result:

The current released major version is v2 — use actions/create-github-app-token@v2. [1][2]

Sources:
[1] actions/create-github-app-token (GitHub repo).
[2] Create GitHub App Token (GitHub Marketplace).


🌐 Web query:

GitHub Actions version pinning best practices floating tags security

💡 Result:

Concise best-practices for pinning GitHub Actions and avoiding floating-tag risks:

  • Pin to a full commit SHA (immutable) whenever possible — SHA pinning is the strongest protection against tag moves/compromise. (docs.github.com)
  • Avoid floating refs like @main, @master, @latest or loose major tags (e.g., @V3) for third‑party actions; they can change unexpectedly. (docs.github.com)
  • If you must use tags for convenience, prefer immutable/release tags from trusted/verified creators and record the corresponding SHA in a comment. (docs.github.com)
  • Enforce org/repo policies that require SHA pinning or block unpinned/floating actions (use Allowed Actions / reusable-workflows policy). (docs.github.com)
  • Automate safe updates: use Dependabot / Renovate or pinning tools to raise PRs that update SHAs so changes are reviewed before merging. (github.com)
  • Restrict runtime blast radius: least‑privilege GITHUB_TOKEN permissions, avoid passing secrets to untrusted actions, and require approvals for sensitive workflows/environments. (docs.github.com)
  • Audit action code (or favor official/verified authors) and monitor for security advisories or compromises. (docs.github.com)

Example (recommended):

  • uses: actions/checkout@ # vX.Y.Z

If you want, I can: scan a repo/workflows for floating tags and produce a PR-ready list of replacements (SHAs + comments).

Citations:


Upgrade to actions/create-github-app-token@v2 and pin to a specific commit SHA.

The action is using @v1, which is outdated; the current released version is @v2. More importantly, using floating major version tags (whether @v1 or @v2) carries security risks. Per GitHub's security hardening guidelines, pin to a full commit SHA for immutability and to prevent unexpected behavior from tag updates. Example:

uses: actions/create-github-app-token@<full-commit-sha>  # v2.Y.Z
🤖 Prompt for AI Agents
In @.github/workflows/release-prepare.yml around lines 37 - 44, The workflow
step with id "app-token" currently uses actions/create-github-app-token@v1;
update it to the v2 release pinned to a full commit SHA instead of a floating
tag to follow security hardening. Replace the "uses:
actions/create-github-app-token@v1" line in the "Generate GitHub App Token" step
with the v2 equivalent pinned to the specific commit SHA (e.g.,
actions/create-github-app-token@<full-commit-sha>) so the action is on the v2
code but immutable.


# Opens/updates the Version Packages PR; publishes when the Version PR merges
- name: Create/Update Version PR
id: changesets
Expand All @@ -45,12 +54,12 @@ jobs:
# so package.json already contains the bumped version.
publish: pnpm run release:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# npm authentication handled via OIDC trusted publishing (no token needed)

# Auto-merge the version PR when CI passes (reduces release to effectively 1 PR)
- name: Enable auto-merge for Version PR
if: steps.changesets.outputs.pullRequestNumber
run: gh pr merge ${{ steps.changesets.outputs.pullRequestNumber }} --auto --squash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Loading