Skip to content

Commit 56c48da

Browse files
rix0rrrgithub-actions
andauthored
chore: integ tests don't work on fork (#780)
* chore: integ tests don't work on fork Because of the `pull_request_target` event we are trying to checkout the source from the base repo instead of the fork. Pass the correct repository name as an argument. * Also update expression that requires human appproval on integ tests * chore: self mutation Signed-off-by: github-actions <[email protected]> --------- Signed-off-by: github-actions <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent a20961c commit 56c48da

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/integ.yml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ test?.addJob('determine_env', {
9696
run: 'echo IntegTestCredentialsRequireApproval > .envname',
9797
},
9898
{
99-
name: 'If not forked, run automatically',
100-
// In a mergeGroup event, `github.pull_request` will not be set and `!undefined` also counts
101-
if: '!github.pull_request.head.repo.fork',
99+
name: 'Run automatically if in a mergeGroup or PR created from this repo',
100+
// In a mergeGroup event, or a non-forked request, run without confirmation
101+
if: "${{ github.event_name == 'merge_group' || github.event.pull_request.head.repo.full_name == github.repository }}",
102102
run: 'echo IntegTestCredentials > .envname',
103103
},
104104
{
@@ -136,6 +136,8 @@ test?.addJob('integ', {
136136
uses: 'actions/checkout@v3',
137137
with: {
138138
ref: '${{ github.event.pull_request.head.ref }}',
139+
// Need this because we are running on pull_request_target
140+
repository: '${{ github.event.pull_request.head.repo.full_name }}',
139141
},
140142
},
141143
{

0 commit comments

Comments
 (0)