Skip to content

Commit 9fb61cc

Browse files
committed
Harden GitHub Actions: pin actions to SHAs and set explicit permissions
1 parent 2d94c5a commit 9fb61cc

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ on:
66
- main
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
trigger-vercel-deploy:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- name: Trigger suite.turbot.com deployment
14-
uses: peter-evans/repository-dispatch@v2
17+
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
1518
with:
1619
token: ${{ secrets.GH_PAT }}
1720
repository: turbot/suite.turbot.com

.github/workflows/trigger-turbot-com.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ on:
1010
pull_request:
1111
types: [opened, synchronize]
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
update:
1518
runs-on: ubuntu-latest
1619
if: ${{ github.event_name == 'push' }}
1720
steps:
1821
- name: Repository Dispatch
19-
uses: peter-evans/repository-dispatch@v2
22+
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2
2023
with:
2124
token: ${{ secrets.GH_PAT }}
2225
repository: turbot/turbot.com
@@ -32,7 +35,7 @@ jobs:
3235
- name: Get the deployment details
3336
id: get_deployment_details
3437
if: ${{ github.event_name == 'pull_request'}}
35-
uses: actions/github-script@v6
38+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
3639
with:
3740
script: |
3841
const branchName = 'docs/pipes/${{ github.event.pull_request.head.ref }}';
@@ -54,7 +57,7 @@ jobs:
5457
}
5558
5659
- name: Add comment with preview link
57-
uses: actions/github-script@v7
60+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
5861
if: ${{ steps.get_deployment_details.outputs.foundDeployment == 'true' }}
5962
with:
6063
script: |

0 commit comments

Comments
 (0)