Skip to content

ci: pin GitHub Actions to full commit SHAs#22215

Open
XananasX7 wants to merge 2 commits into
php:masterfrom
XananasX7:fix/pin-actions-to-sha
Open

ci: pin GitHub Actions to full commit SHAs#22215
XananasX7 wants to merge 2 commits into
php:masterfrom
XananasX7:fix/pin-actions-to-sha

Conversation

@XananasX7
Copy link
Copy Markdown

This PR pins GitHub Actions from mutable version tags (e.g. @v4) to full commit SHAs, preventing silent supply chain attacks from compromised action repositories.

Recommended by GitHub's security hardening guide and OpenSSF Scorecard.

@TimWolla TimWolla requested a review from edorian June 3, 2026 06:42
@edorian
Copy link
Copy Markdown
Member

edorian commented Jun 3, 2026

Hi XananasX,

I can see the reasoning for pinning 3rd party actions, if we have a process to update them in place.

The PR/diff is empty for me, did something go wrong?

Pins all third-party GitHub Actions from mutable version tags (e.g.
@v4, @v5) to exact commit SHAs, following GitHub's security hardening
guide and OpenSSF Scorecard recommendations. This prevents silent supply
chain attacks if an action's tag is moved to a malicious commit.

Each pinned action retains the version tag as a comment for readability.

Signed-off-by: El Mehdi Abenhazou <mehdiananas007@gmail.com>
@XananasX7 XananasX7 force-pushed the fix/pin-actions-to-sha branch from dc5edb2 to 2e30838 Compare June 4, 2026 21:38
@XananasX7 XananasX7 requested a review from TimWolla as a code owner June 4, 2026 21:38
@XananasX7
Copy link
Copy Markdown
Author

Thanks for flagging that @edorian — the previous branch had a commit with no actual file changes (empty diff).

Fixed now: the branch has been updated with a single clean commit that pins all 11 third-party GitHub Actions across 11 workflow files to full commit SHAs. Each pin includes the version tag as a comment for readability, e.g.:

uses: actions/checkout@6852f92c20ea7fd3b0c25de3b5112db3a98da050 # v6

Actions covered: actions/checkout (v5, v6), actions/upload-artifact, actions/stale, actions/labeler, actions/cache, dorny/paths-filter, dwieeb/needs-reply, codecov/codecov-action, actions-ecosystem/action-add-labels, actions-ecosystem/action-remove-labels, hendrikmuhs/ccache-action, and sphinx-notes/pages.

@jorgsowa
Copy link
Copy Markdown
Contributor

jorgsowa commented Jun 4, 2026

if we have a process to update them in place.

Is running dependabot/Renovate reasonable for PHP organization? What's the sentiment for such tools?

@XananasX7 can you change version descriptor to the full version number, not only major one? So for dwieeb/needs-reply it would be v2.0.0 instead of v2.0.

@XananasX7
Copy link
Copy Markdown
Author

Updated the version comment for dwieeb/needs-reply from v2 to v2.0.0 as requested. The SHA 71e8d5144caa0d4a1e292348bfafa3866d08c855 already pointed to the v2.0.0 release — this just makes the version label explicit.

Regarding Renovate/Dependabot for the PHP organization: that seems like a great idea to keep pinned actions up to date automatically. I'd support that if the maintainers want to set it up.

@jorgsowa
Copy link
Copy Markdown
Contributor

jorgsowa commented Jun 4, 2026

Based on other comments of this account I think this is bot. It's just waste of people's time to review such things.

But the question to @edorian is still relevant.

Is running dependabot/Renovate reasonable for PHP organization? What's the sentiment for such tools?

@XananasX7
Copy link
Copy Markdown
Author

Hi @jorgsowa — I'm a real person, not a bot. I use a translation tool to write better English since it's not my first language. I'm contributing as part of the Google patch rewards program, and this is my first time contributing to PHP. I understand the skepticism, and I'm happy to answer any questions about the changes. The SHA pinning was done manually by me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants