Skip to content

Commit 05eed9a

Browse files
authored
Merge pull request #28 from ThirdSpaceLearning/improve-session-creation-action
run test session based on the branch
2 parents 3d4bfec + 8cb0143 commit 05eed9a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/create_session.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,28 @@ jobs:
3737
id: branch_name
3838
run: |
3939
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
40-
echo "TEST_SESSION_STATE_MACHINE_ARN=${{ secrets.TEST_SESSION_STATE_MACHINE_ARN }}" >> $GITHUB_ENV
4140
echo "AI_TUTOR_ID=${{ secrets.AI_TUTOR_ID }}" >> $GITHUB_ENV
4241
echo "START_SESSION=${{ github.event.inputs.start_session == 'yes' }}" >> $GITHUB_ENV
4342
echo "NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
4443
45-
- name: configure aws credentials
44+
- name: Set State machine for main branch
45+
if: env.BRANCH_NAME == 'main'
46+
run: echo "TEST_SESSION_STATE_MACHINE_ARN=${{ secrets.PROD_TEST_SESSION_STATE_MACHINE_ARN }}" >> $GITHUB_ENV
47+
48+
- name: Set AWS Role for main branch
49+
if: env.BRANCH_NAME == 'main'
50+
uses: aws-actions/configure-aws-credentials@v4
51+
with:
52+
role-to-assume: arn:aws:iam::332632916255:role/prod-deployer
53+
role-session-name: prompt-library-action
54+
aws-region: eu-west-1
55+
56+
- name: Set State machine for main branch
57+
if: env.BRANCH_NAME != 'main'
58+
run: echo "TEST_SESSION_STATE_MACHINE_ARN=${{ secrets.NONPROD_TEST_SESSION_STATE_MACHINE_ARN }}" >> $GITHUB_ENV
59+
60+
- name: Set AWS Role for non-main branches
61+
if: env.BRANCH_NAME != 'main'
4662
uses: aws-actions/configure-aws-credentials@v4
4763
with:
4864
role-to-assume: arn:aws:iam::267739230747:role/nonprod-deployer

0 commit comments

Comments
 (0)