21
21
id-token : write # needed to interact with GitHub's OIDC Token endpoint.
22
22
contents : read
23
23
strategy :
24
- max-parallel : 30
25
24
matrix :
26
25
package :
27
26
[
@@ -42,11 +41,14 @@ jobs:
42
41
- name : Extract PR details
43
42
id : extract_PR_details
44
43
if : ${{ inputs.prNumber != '' }}
45
- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
46
- with :
47
- script : |
48
- const script = require('.github/scripts/get_pr_info.js');
49
- await script({github, context, core});
44
+ run : |
45
+ # Get the PR number from the input
46
+ pr_number=${{ inputs.prNumber }}
47
+ # Get the headSHA of the PR
48
+ head_sha=$(gh pr view $pr_number --json headRefOid -q '.headRefOid')
49
+ # Set the headSHA as an output variable
50
+ echo "headSHA=$head_sha" >> $GITHUB_OUTPUT
51
+ echo "headSHA=$head_sha"
50
52
# Only if a PR Number was passed and the headSHA of the PR extracted,
51
53
# we checkout the PR at that point in time
52
54
- name : Checkout PR code
@@ -62,11 +64,20 @@ jobs:
62
64
uses : aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
63
65
with :
64
66
nodeVersion : ' 22'
67
+ - name : Select region
68
+ id : select_region
69
+ run : |
70
+ regions_available=(eu-west-1 us-east-1)
71
+ region=${regions_available[$((RANDOM % ${#regions[@]}))]}
72
+ region=${regions_available[$((RANDOM % ${#regions_available[@]}))]}
73
+ # Set the region as an output variable
74
+ echo "region=$region" >> $GITHUB_OUTPUT
75
+ echo "deployment_region=$region"
65
76
- name : Setup AWS credentials
66
77
uses : aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
67
78
with :
68
79
role-to-assume : ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
69
- aws-region : eu-west-1
80
+ aws-region : ${{ steps.select_region.outputs.region }}
70
81
mask-aws-account-id : true
71
82
- name : Run integration tests on utils
72
83
env :
0 commit comments