ci: pin actions to commit SHAs#5771
Open
yoshinorin wants to merge 1 commit intomasterfrom
Open
Conversation
How to testgit clone -b chore/ci/pinned-version https://github.com/hexojs/hexo.git
cd hexo
npm install
npm test |
yoshinorin
commented
May 7, 2026
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2 |
Member
Author
There was a problem hiding this comment.
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v6 | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #6.4.0 |
Member
Author
There was a problem hiding this comment.
| run: node test/benchmark.js --profiling | ||
| - name: Publish flamegraph to https://${{ github.sha }}-${{ matrix.node-version }}-hexo.surge.sh/flamegraph.html | ||
| uses: dswistowski/surge-sh-action@v1 | ||
| uses: dswistowski/surge-sh-action@2ef23bb28f7240e4922a44df1807022af43782bf #1.1.0 |
Member
Author
There was a problem hiding this comment.
| echo "https://${{ github.sha }}-${{ matrix.node-version }}-hexo.surge.sh/flamegraph.html" > ${{env.comment_file}} | ||
|
|
||
| - uses: actions/upload-artifact@v7 | ||
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #7.0.1 |
Member
Author
There was a problem hiding this comment.
| steps: | ||
| - name: Comment PR - How to test | ||
| uses: marocchino/sticky-pull-request-comment@v3 | ||
| uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 #3.0.4 |
Member
Author
There was a problem hiding this comment.
| - name: Comment PR - flamegraph | ||
| if: ${{env.pr_number!=''}} | ||
| uses: marocchino/sticky-pull-request-comment@v3 | ||
| uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 #3.0.4 |
Member
Author
There was a problem hiding this comment.
| CI: true | ||
| - name: Coveralls | ||
| uses: coverallsapp/github-action@master | ||
| uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b #2.3.6 |
Member
Author
There was a problem hiding this comment.
Coverage Report for CI Build 25502740606Coverage remained the same at 99.501%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Pin all GitHub Actions in workflows to commit SHAs (with version comments) for supply-chain safety.
Initially I planned to pin only third-party actions. However, mixing pinned and unpinned references across the same workflow files would be confusing.
To keep things consistent and reviewable, I decided to pin every uses: reference, including the official actions ones. Dependabot will automatically open update PRs for the pinned SHAs, so the ongoing maintenance cost stays low once this is set up.
Screenshots
N/A
Pull request tasks
Add test cases for the changes.