Skip to content

Commit 1e14fcd

Browse files
TASK AS Prevent branches from publishing build packages to S3
1 parent 23d9c51 commit 1e14fcd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/stage-3-build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ jobs:
6464
run: |
6565
echo "Workflow URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> workflow.log
6666
- name: "Configure AWS credentials"
67+
if: github.ref == 'refs/heads/main'
6768
uses: aws-actions/configure-aws-credentials@v5
6869
with:
6970
role-session-name: GitHubActionsSession
7071
role-to-assume: ${{ secrets.IAM_ROLE }}
7172
aws-region: ${{ env.AWS_REGION }}
7273
- name: "Upload Packages To S3"
74+
if: github.ref == 'refs/heads/main'
7375
run: | # Prevent overwriting of existing artefacts
7476
aws s3api put-object --bucket "${AWS_S3_ARTEFACTS_BUCKET}" --key "sha/${{ github.sha }}/open-next.zip" --body "open-next.zip" --if-none-match '*' || {
7577
echo "❌ Uploading open-next.zip to S3 bucket failed!"

0 commit comments

Comments
 (0)