Skip to content

Commit

Permalink
fix: add caller identity check (#44)
Browse files Browse the repository at this point in the history
* fix: add caller identity check

* fix: auto approve dependency on attest removed
  • Loading branch information
saidsef authored Jul 20, 2024
1 parent b1e483a commit 29bfade
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ jobs:
uses: saidsef/saidsef/.github/workflows/tf-attest.yaml@main
needs: [tfsec]

caller-identity-check:
if: contains(github.event_name, 'pull_request')
name: Return the IAM user
needs: [validate, tfsec]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions
role-session-name: ${{ github.event.repository.name }}-${{ github.ref_type }}
- run: |
aws sts get-caller-identity
auto-approve:
uses: saidsef/saidsef/.github/workflows/auto-approve.yaml@main
needs: [validate, tfsec]
needs: [validate, tfsec, caller-identity-check]

0 comments on commit 29bfade

Please sign in to comment.