alibaba / alibaba/open-code-review

Release workflow references actions by floating tags while holding npm and attestation credentials

Open Beginner friendly
#841 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
24.4k
Forks
1.8k
Avg merge
2d 6h
Merged PRs (30d)
105

Description

## Problem

Follow-up from [#836 review](https://github.com/alibaba/open-code-review/pull/836#pullrequestreview-3550463356): `.github/workflows/release.yml` references third-party actions by floating tags while running with the repository's most sensitive credentials — `secrets.NPM_TOKEN` plus `id-token`/`attestations` permissions for provenance. A compromised or hijacked tag there has a wider blast radius than the same drift in CI: it can exfiltrate the npm token or publish tampered artifacts with valid-looking provenance.

Current floating references (`main`):

| Line | Reference |
|---|---|
| 33, 74, 171 | `actions/checkout@v7` |
| 55 | `actions/upload-artifact@v4` |
| 139, 179 | `actions/download-artifact@v4` |
| 148 | `softprops/action-gh-release@v3` |
| 156 | `actions/attest-build-provenance@v4` |

`softprops/action-gh-release` deserves particular care: it is a third-party (non-`actions/*`) action running in the job that holds release permissions.

## Suggestion

1. Pin every `uses:` in `release.yml` to a full commit SHA with the `# vX.Y.Z` comment, same convention as #836 established for `action.yml`.
2. Add `.github/workflows/release.yml` to the `files` array in `scripts/verify-action-pins.sh` so the invariant is CI-enforced.
3. Optionally extend to the remaining workflows later; `release.yml` first because of the credential exposure.

Happy to send the PR once #836 lands (it builds on the same check script).

Contributor guide

Open the contributing guide

Research direction

Read .github/workflows/release.yml and compare its action references with the pinning convention established by #836. Then inspect scripts/verify-action-pins.sh and verify that release.yml is covered. Done means all listed uses entries are pinned to full commit SHAs with version comments and the verifier enforces the workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, release, security
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.