Skip to content

Commit 3644849

Browse files
Copilotfengmk2
andauthored
chore: pin GitHub Actions to commit SHAs for security compliance (#5512)
This PR updates all GitHub Actions workflows to use full-length commit SHAs instead of version tags to comply with GitHub's security requirement for pinned actions. ## Background GitHub now provides an option to "Require actions to be pinned to a full-length commit SHA" in repository settings for enhanced security. This prevents potential supply chain attacks by ensuring workflows use specific, immutable versions of actions rather than mutable tags that could be changed by attackers. ## Changes Made Updated both `.github/workflows/ci.yml` and `.github/workflows/release.yml` to pin all actions: - `actions/checkout@v5` → `actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8` - `actions/setup-node@v5` → `actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444` - `pnpm/action-setup@v4` → `pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab` - `actions/github-script@v8` → `actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd` - `codecov/codecov-action@v5` → `codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7` Each action now includes an inline comment showing the original version (e.g., `# v5`) for maintainability and easy reference when updating in the future. ## Validation - ✅ All workflows are syntactically valid - ✅ Build and lint processes continue to work correctly - ✅ No functional changes to CI/CD behavior This is a security-focused maintenance update with no impact on functionality. Fixes #5506. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent 2906a2c commit 3644849

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Cancel running workflows on PR close/merge
22-
uses: actions/github-script@v8
22+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
2323
with:
2424
script: |
2525
const { owner, repo } = context.repo;
@@ -61,13 +61,13 @@ jobs:
6161
cancel-in-progress: true
6262
steps:
6363
- name: Checkout repository
64-
uses: actions/checkout@v5
64+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
6565

6666
- name: Install pnpm
67-
uses: pnpm/action-setup@v4
67+
uses: pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab # v4
6868

6969
- name: Set up Node.js
70-
uses: actions/setup-node@v5
70+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
7171
with:
7272
node-version: '22'
7373
cache: 'pnpm'
@@ -97,13 +97,13 @@ jobs:
9797

9898
steps:
9999
- name: Checkout repository
100-
uses: actions/checkout@v5
100+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
101101

102102
- name: Install pnpm
103-
uses: pnpm/action-setup@v4
103+
uses: pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab # v4
104104

105105
- name: Set up Node.js
106-
uses: actions/setup-node@v5
106+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
107107
with:
108108
node-version: ${{ matrix.node }}
109109
cache: 'pnpm'
@@ -117,7 +117,7 @@ jobs:
117117
- name: Code Coverage
118118
# skip on windows, it will hangup on codecov
119119
if: ${{ matrix.os != 'windows-latest' }}
120-
uses: codecov/codecov-action@v5
120+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
121121
with:
122122
use_oidc: true
123123

@@ -137,13 +137,13 @@ jobs:
137137

138138
steps:
139139
- name: Checkout repository
140-
uses: actions/checkout@v5
140+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
141141

142142
- name: Install pnpm
143-
uses: pnpm/action-setup@v4
143+
uses: pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab # v4
144144

145145
- name: Set up Node.js
146-
uses: actions/setup-node@v5
146+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
147147
with:
148148
node-version: ${{ matrix.node }}
149149
cache: 'pnpm'
@@ -157,6 +157,6 @@ jobs:
157157
- name: Code Coverage
158158
# skip on windows, it will hangup on codecov https://github.com/codecov/codecov-action/issues/1787
159159
if: ${{ matrix.os != 'windows-latest' }}
160-
uses: codecov/codecov-action@v5
160+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
161161
with:
162162
use_oidc: true

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ jobs:
5555

5656
steps:
5757
- name: Checkout
58-
uses: actions/checkout@v5
58+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
5959
with:
6060
ref: ${{ github.event.inputs.branch }}
6161
fetch-depth: 0
6262
# Use git token for checkout and pushing
6363
token: ${{ secrets.GIT_TOKEN }}
6464

6565
- name: Setup pnpm
66-
uses: pnpm/action-setup@v4
66+
uses: pnpm/action-setup@36de12bed180fa130ed56a35e7344f2fa7a820ab # v4
6767

6868
- name: Setup Node.js
69-
uses: actions/setup-node@v5
69+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
7070
with:
7171
node-version: '22'
7272
cache: 'pnpm'
@@ -141,7 +141,7 @@ jobs:
141141
142142
- name: Create GitHub Release (draft)
143143
if: ${{ github.event.inputs.dry_run != 'true' }}
144-
uses: actions/github-script@v8
144+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
145145
with:
146146
github-token: ${{ secrets.GIT_TOKEN }}
147147
script: |

0 commit comments

Comments
 (0)