Skip to content

Commit 00b87c9

Browse files
HyukjinKwonnaveensrinivasan
authored andcommitted
[SPARK-36915][INFRA] Pin actions to a full length commit SHA
### What changes were proposed in this pull request? Pinning github actions to a SHA ### Why are the changes needed? Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies ### Does this PR introduce _any_ user-facing change? Running github action and checking the SHA with the existing repository ### How was this patch tested? Running the GitHub action Closes apache#34163 from naveensrinivasan/naveen/feat/pin-github-actions. Lead-authored-by: Hyukjin Kwon <[email protected]> Co-authored-by: naveen <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 67b547a commit 00b87c9

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

.github/workflows/cancel_duplicate_workflow_runs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: "Cancel duplicate workflow runs"
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: potiuk/cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738 # @master
32+
- uses: potiuk/cancel-workflow-runs@4723494a065d162f8e9efd071b98e0126e00f866 # @master
3333
name: "Cancel duplicate workflow runs"
3434
with:
3535
cancelMode: allDuplicates

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
#
4545
# However, these are not in a published release and the current `main` branch
4646
# has some issues upon testing.
47-
- uses: actions/[email protected]
47+
- uses: actions/labeler@5f867a63be70efff62b767459b009290364495eb # pin@2.2.0
4848
with:
4949
repo-token: "${{ secrets.GITHUB_TOKEN }}"
5050
sync-labels: true

.github/workflows/notify_test_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-20.04
3434
steps:
3535
- name: "Notify test workflow"
36-
uses: actions/github-script@v3
36+
uses: actions/github-script@f05a81df23035049204b043b50c3322045ce7eb3 # pin@v3
3737
if: ${{ github.base_ref == 'master' }}
3838
with:
3939
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish_snapshot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ jobs:
3636
- branch-3.1
3737
steps:
3838
- name: Checkout Spark repository
39-
uses: actions/checkout@master
39+
uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089 # pin@master
4040
with:
4141
ref: ${{ matrix.branch }}
4242
- name: Cache Maven local repository
43-
uses: actions/cache@v2
43+
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2
4444
with:
4545
path: ~/.m2/repository
4646
key: snapshot-maven-${{ hashFiles('**/pom.xml') }}
4747
restore-keys: |
4848
snapshot-maven-
4949
- name: Install Java 8
50-
uses: actions/setup-java@v1
50+
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # pin@v1
5151
with:
5252
java-version: 8
5353
- name: Publish snapshot

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
stale:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/[email protected]
30+
- uses: actions/stale@c201d45ef4b0ccbd3bb0616f93bae13e73d0a080 # pin@v1.1.0
3131
with:
3232
repo-token: ${{ secrets.GITHUB_TOKEN }}
3333
stale-pr-message: >

.github/workflows/test_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Download test results to report
32-
uses: dawidd6/action-download-artifact@v2
32+
uses: dawidd6/action-download-artifact@6f8f427fb41886a66b82ea11a5a15d1454c79415 # pin@v2
3333
with:
3434
github_token: ${{ secrets.GITHUB_TOKEN }}
3535
workflow: ${{ github.event.workflow_run.workflow_id }}
3636
commit: ${{ github.event.workflow_run.head_commit.id }}
3737
workflow_conclusion: completed
3838
- name: Publish test report
39-
uses: scacap/action-surefire-report@v1
39+
uses: scacap/action-surefire-report@482f012643ed0560e23ef605a79e8e87ca081648 # pin@v1
4040
with:
4141
check_name: Report test results
4242
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/update_build_status.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ubuntu-20.04
3030
steps:
3131
- name: "Update build status"
32-
uses: actions/github-script@v3
32+
uses: actions/github-script@f05a81df23035049204b043b50c3322045ce7eb3 # pin@v3
3333
with:
3434
github-token: ${{ secrets.GITHUB_TOKEN }}
3535
script: |

0 commit comments

Comments
 (0)