Skip to content

Commit 2344721

Browse files
authored
fix(chore): Pin github actions to specific commit (#4772)
1 parent d68b71b commit 2344721

File tree

7 files changed

+48
-25
lines changed

7 files changed

+48
-25
lines changed

.github/workflows/check-repro.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,23 @@ jobs:
1010
if: ${{ github.event.label.name == 'bug' }}
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
13+
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.
1414
with:
1515
github-token: ${{ secrets.GITHUB_TOKEN }}
1616
script: |
17+
if (context.eventName === 'issue_comment') {
18+
const actor = context.actor;
19+
const { data: collaborators } = await github.rest.repos.listCollaborators({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
});
23+
24+
const isCollaborator = collaborators.some(collaborator => collaborator.login === actor);
25+
if (!isCollaborator) {
26+
console.log(`Actor ${actor} is not a collaborator, skipping workflow`);
27+
return;
28+
}
29+
}
1730
const user = context.payload.sender.login;
1831
const body = context.payload.comment
1932
? context.payload.comment.body

.github/workflows/publish-each-pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ jobs:
88
if: github.event.pull_request.head.repo.full_name == 'callstack/react-native-paper'
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
1212

1313
- name: Setup Node.js
14-
uses: actions/setup-node@v4
14+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
1515
with:
1616
node-version-file: .nvmrc
1717

1818
- name: Setup Expo
19-
uses: expo/expo-github-action@v7
19+
uses: expo/expo-github-action@d300b960e9f91a8c59b2aaca92e89ad70b0785ac # v7
2020
with:
2121
eas-version: latest
2222
token: ${{ secrets.EXPO_TOKEN }}
2323

2424
- name: Restore dependencies
2525
id: yarn-cache
26-
uses: actions/cache/restore@v4
26+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
2727
with:
2828
path: '**/node_modules'
2929
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
@@ -40,7 +40,7 @@ jobs:
4040
4141
- name: Cache dependencies
4242
if: steps.yarn-cache.outputs.cache-hit != 'true'
43-
uses: actions/cache/save@v4
43+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
4444
with:
4545
path: '**/node_modules'
4646
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
@@ -55,7 +55,7 @@ jobs:
5555
run: echo "EXPO_CONFIG=$(npx expo config --json)" >> $GITHUB_OUTPUT
5656

5757
- name: Comment on PR
58-
uses: actions/github-script@v7
58+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
5959
with:
6060
github-token: ${{ secrets.GITHUB_TOKEN }}
6161
script: |

.github/workflows/semantic-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
name: Validate PR title
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: amannn/[email protected]
9+
- uses: amannn/action-semantic-pull-request@91682d013dea3ff257520b9b68c9cb93ced4fe9b # v4.5.0
1010
env:
1111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1212
with:

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
stale:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/stale@v9
11+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9
1212
with:
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}
1414
days-before-stale: 30

.github/workflows/triage.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,30 @@ jobs:
88
runs-on: ubuntu-latest
99
if: github.event.label.name == 'needs more info'
1010
steps:
11-
- uses: actions/checkout@master
12-
- uses: actions/[email protected]
13-
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
12+
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
1513
with:
16-
args: comment "Hey! Thanks for opening the issue. Can you provide more information about the issue? Please fill the issue template when opening the issue without deleting any section. We need all the information we can, to be able to help. Make sure to at least provide - Current behaviour, Expected behaviour, A way to reproduce the issue with minimal code (link to [snack.expo.dev](https://snack.expo.dev)) or a repo on GitHub, and the information about your environment (such as the platform of the device, versions of all the packages etc.)."
14+
github-token: ${{ secrets.GITHUB_TOKEN }}
15+
script: |
16+
github.rest.issues.createComment({
17+
issue_number: context.issue.number,
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
body: "Hey! Thanks for opening the issue. Can you provide more information about the issue? Please fill the issue template when opening the issue without deleting any section. We need all the information we can, to be able to help. Make sure to at least provide - Current behaviour, Expected behaviour, A way to reproduce the issue with minimal code (link to [snack.expo.dev](https://snack.expo.dev)) or a repo on GitHub, and the information about your environment (such as the platform of the device, versions of all the packages etc.)."
21+
})
1722
1823
needs-repro:
1924
runs-on: ubuntu-latest
2025
if: github.event.label.name == 'needs repro'
2126
steps:
22-
- uses: actions/checkout@master
23-
- uses: actions/[email protected]
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
28+
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
2629
with:
27-
args: comment "Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on [snack.expo.dev](https://snack.expo.dev). If it's not possible to repro it on [snack.expo.dev](https://snack.expo.dev), then you can also provide the repro in a GitHub repository."
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
script: |
32+
github.rest.issues.createComment({
33+
issue_number: context.issue.number,
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
body: "Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on [snack.expo.dev](https://snack.expo.dev). If it's not possible to repro it on [snack.expo.dev](https://snack.expo.dev), then you can also provide the repro in a GitHub repository."
37+
})

.github/workflows/updates.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
1414

1515
- name: Setup Node.js
16-
uses: actions/setup-node@v4
16+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
1717
with:
1818
node-version-file: .nvmrc
1919

2020
- name: Setup Expo
21-
uses: expo/expo-github-action@v7
21+
uses: expo/expo-github-action@d300b960e9f91a8c59b2aaca92e89ad70b0785ac # v7
2222
with:
2323
expo-version: latest
2424
eas-version: latest
2525
token: ${{ secrets.EXPO_TOKEN }}
2626

2727
- name: Restore dependencies
2828
id: yarn-cache
29-
uses: actions/cache/restore@v4
29+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4
3030
with:
3131
path: '**/node_modules'
3232
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
@@ -43,7 +43,7 @@ jobs:
4343
4444
- name: Cache dependencies
4545
if: steps.yarn-cache.outputs.cache-hit != 'true'
46-
uses: actions/cache/save@v4
46+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4
4747
with:
4848
path: '**/node_modules'
4949
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
if: ${{ github.event.label.name == 'bug' }}
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: react-navigation/[email protected]
11+
- uses: react-navigation/check-versions-action@deac0a153b834fdda425028be69b2cf786dacc31 # v1.1.0
1212
with:
1313
github-token: ${{ secrets.GITHUB_TOKEN }}
1414
required-packages: |

0 commit comments

Comments
 (0)