Skip to content

Commit

Permalink
chore: fix integ test workflow to avoid possible race condition (#1148)
Browse files Browse the repository at this point in the history
Between approval of the integ test deployment and the GH Actions runner picking up the job, the contents of the referenced branch could change because `pull_request.head.ref` is mutable. Using `sha` instead which is immutable.

This PR also updates the action versions for this workflow.
  • Loading branch information
mrgrain authored Apr 10, 2024
1 parent b8584c5 commit e2cfddb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/integ.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test?.addJob('integ', {
steps: [
{
name: 'Federate into AWS',
uses: 'aws-actions/configure-aws-credentials@v2',
uses: 'aws-actions/configure-aws-credentials@v4',
with: {
'aws-region': 'us-east-1',
'role-to-assume': '${{ secrets.AWS_ROLE_TO_ASSUME }}',
Expand All @@ -131,16 +131,16 @@ test?.addJob('integ', {
},
{
name: 'Checkout',
uses: 'actions/checkout@v3',
uses: 'actions/checkout@v4',
with: {
ref: '${{ github.event.pull_request.head.ref }}',
ref: '${{ github.event.pull_request.head.sha }}',
// Need this because we are running on pull_request_target
repository: '${{ github.event.pull_request.head.repo.full_name }}',
},
},
{
name: 'Setup Node.js',
uses: 'actions/setup-node@v3',
uses: 'actions/setup-node@v4',
with: {
cache: 'yarn',
},
Expand Down

0 comments on commit e2cfddb

Please sign in to comment.