Skip to content

Commit 85e0e78

Browse files
authored
Merge pull request #100 from 1Password/fix/fork-workflow
In #97 it was missed to adjust the reusable workflow to pull changes from the forked commit. Instead, now we pull from base repository, which doesn't contain the external contributor's changes. I've also improved the way we reference the reusable workflow to ensure we're using a trusted reusable workflow that won't change often.
2 parents a5e5c78 + 39cf694 commit 85e0e78

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

.github/workflows/acceptance-test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ jobs:
2929
steps:
3030
- name: Base checkout
3131
uses: actions/checkout@v4
32+
if: |
33+
github.event_name != 'repository_dispatch' &&
34+
(
35+
github.ref == 'refs/heads/main' ||
36+
(
37+
github.event_name == 'pull_request' &&
38+
github.event.pull_request.head.repo.full_name == github.repository
39+
)
40+
)
41+
- name: Fork based /ok-to-test checkout
42+
uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.event.client_payload.pull_request.head.sha }}
45+
if: |
46+
github.event_name == 'repository_dispatch' &&
47+
github.event.client_payload.slash_command.args.named.sha != '' &&
48+
contains(
49+
github.event.client_payload.pull_request.head.sha,
50+
github.event.client_payload.slash_command.args.named.sha
51+
)
3252
- name: Launch 1Password Connect instance
3353
if: ${{ matrix.auth == 'connect' }}
3454
env:

.github/workflows/test-fork.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
github.event.client_payload.pull_request.head.sha,
1313
github.event.client_payload.slash_command.args.named.sha
1414
)
15-
uses: ./.github/workflows/acceptance-test.yml
15+
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
1616
secrets: inherit
1717
with:
1818
secret: op://acceptance-tests/test-secret/password
@@ -27,7 +27,7 @@ jobs:
2727
github.event.client_payload.pull_request.head.sha,
2828
github.event.client_payload.slash_command.args.named.sha
2929
)
30-
uses: ./.github/workflows/acceptance-test.yml
30+
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
3131
secrets: inherit
3232
with:
3333
secret: op://acceptance-tests/test-secret/password
@@ -42,7 +42,7 @@ jobs:
4242
github.event.client_payload.pull_request.head.sha,
4343
github.event.client_payload.slash_command.args.named.sha
4444
)
45-
uses: ./.github/workflows/acceptance-test.yml
45+
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
4646
secrets: inherit
4747
with:
4848
secret: op://v5pz6venw4roosmkzdq2nhpv6u/hrgkzhrlvscomepxlgafb2m3ca/password

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
github.event_name == 'pull_request' &&
2222
github.event.pull_request.head.repo.full_name == github.repository
2323
)
24-
uses: ./.github/workflows/acceptance-test.yml
24+
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
2525
secrets: inherit
2626
with:
2727
secret: op://acceptance-tests/test-secret/password
@@ -35,7 +35,7 @@ jobs:
3535
github.event_name == 'pull_request' &&
3636
github.event.pull_request.head.repo.full_name == github.repository
3737
)
38-
uses: ./.github/workflows/acceptance-test.yml
38+
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
3939
secrets: inherit
4040
with:
4141
secret: op://acceptance-tests/test-secret/password
@@ -49,7 +49,7 @@ jobs:
4949
github.event_name == 'pull_request' &&
5050
github.event.pull_request.head.repo.full_name == github.repository
5151
)
52-
uses: ./.github/workflows/acceptance-test.yml
52+
uses: 1password/load-secrets-action/.github/workflows/acceptance-test.yml@main
5353
secrets: inherit
5454
with:
5555
secret: op://v5pz6venw4roosmkzdq2nhpv6u/hrgkzhrlvscomepxlgafb2m3ca/password

0 commit comments

Comments
 (0)