Skip to content

ci: use electron/semantic-trusted-release instead of npx#127

Merged
MarshallOfSound merged 1 commit intomainfrom
sam/use-semantic-trusted-release
Mar 31, 2026
Merged

ci: use electron/semantic-trusted-release instead of npx#127
MarshallOfSound merged 1 commit intomainfrom
sam/use-semantic-trusted-release

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

Replaces unpinned npx semantic-release with the org-standard electron/semantic-trusted-release composite action.

The problem:

- run: npx semantic-release  # ← fetches @latest from registry, no pin, no local dep
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This fetches semantic-release@latest from npm on every release run, with GITHUB_TOKEN (contents: write) in scope. A compromised semantic-release release would get code execution with push-tag/create-release privileges.

The fix:
electron/semantic-trusted-release installs semantic-release from a frozen yarn.lock — same pattern already used by 26 other repos in the org (secret-service-action is the closest analog since it's also a GitHub Action, not an npm package).

The existing .releaserc.json is already identical to secret-service-action's — just commit-analyzer / release-notes-generator / @semantic-release/github, all bundled with semantic-release core. No config changes needed.

Also in this PR:

  • Dropped the redundant setup-node step — the composite action brings its own pinned Node
  • Added persist-credentials: false on checkout (semantic-release uses the passed-in token, not checkout creds)
  • Added pull-requests: write / issues: write permissions so semantic-release can comment on linked PRs/issues with the release version

Replaces unpinned npx semantic-release with the org-standard
electron/semantic-trusted-release composite action. The previous
invocation fetched semantic-release@latest from the registry on
every release with publish credentials in scope.

The .releaserc.json already matches what secret-service-action
uses (commit-analyzer, release-notes-generator, github — all
bundled with semantic-release core), so no config changes needed.

Also:
- drops the redundant setup-node step (the composite action has its own)
- adds persist-credentials: false on checkout
- adds pull-requests/issues write permissions for release comments
@MarshallOfSound MarshallOfSound requested review from a team as code owners March 31, 2026 05:06
@MarshallOfSound MarshallOfSound merged commit 4d9402a into main Mar 31, 2026
22 checks passed
@MarshallOfSound MarshallOfSound deleted the sam/use-semantic-trusted-release branch March 31, 2026 05:49
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.

2 participants