fix: mock aws data sources in tests #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: TF Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request_target: | |
| permissions: | |
| actions: read | |
| checks: write | |
| contents: read | |
| id-token: write | |
| pull-requests: read | |
| jobs: | |
| tf-test: | |
| name: 🧪 ${{ matrix.tf }} test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| tf: [tofu, terraform] | |
| steps: | |
| # Only checkout for pull_request_target events (not for push to main) | |
| # pull_request_target runs in the context of the base branch for security, | |
| # so we must explicitly checkout the PR's head commit to test the actual changes | |
| - name: Checkout PR Head | |
| if: github.event_name != 'push' | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - uses: masterpointio/github-action-tf-test@c3b619f3bca9e4f482b9e0fb3166ab3f02d9d54c # v1.0.0 | |
| with: | |
| tf_type: ${{ matrix.tf }} | |
| aws_role_arn: ${{ vars.TF_TEST_AWS_ROLE_ARN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |