Update dependency aquaproj/aqua to v2.17.0 (.github/workflows) #362
This file contains 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: test | |
on: | |
pull_request: | |
branches: [main] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TFACTION_IS_APPLY: 'false' | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: write | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
tfmigrate_targets: ${{ steps.list-targets.outputs.tfmigrate_targets }} | |
terraform_targets: ${{ steps.list-targets.outputs.terraform_targets }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: aquaproj/[email protected] | |
with: | |
aqua_version: v2.17.0 | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
id: list-targets | |
tfmigrate-plan: | |
name: "tfmigrate-plan (${{matrix.target.target}})" | |
runs-on: ${{matrix.target.runs_on}} | |
needs: setup | |
# if services is empty, the build job is skipped | |
if: "join(fromJSON(needs.setup.outputs.tfmigrate_targets), '') != ''" | |
strategy: | |
fail-fast: false | |
matrix: | |
target: ${{fromJSON(needs.setup.outputs.tfmigrate_targets)}} | |
env: | |
TFACTION_TARGET: ${{matrix.target.target}} | |
TFACTION_JOB_TYPE: tfmigrate | |
steps: | |
- uses: actions/checkout@v3 | |
# We recommend using GitHub App Token instead of personal access token, | |
# but in this getting started let's use personal access token. | |
# - name: Generate token | |
# id: generate_token | |
# uses: tibdex/github-app-token@v1 | |
# with: | |
# app_id: ${{ secrets.APP_ID }} | |
# private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- uses: aquaproj/[email protected] | |
with: | |
aqua_version: v2.17.0 | |
- uses: suzuki-shunsuke/tfaction/export-secrets@main | |
with: | |
secrets: ${{ toJSON(secrets) }} | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
id: setup | |
with: | |
github_app_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
ssh_key: ${{ secrets.TERRAFORM_PRIVATE_MODULE_SSH_KEY }} # This isn't needed if you don't use SSH key to checkout private Terraform Modules | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
with: | |
github_app_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
with: | |
github_app_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
terraform-plan: | |
name: "terraform-plan (${{matrix.target.target}})" | |
runs-on: ${{matrix.target.runs_on}} | |
needs: setup | |
# if services is empty, the build job is skipped | |
if: "join(fromJSON(needs.setup.outputs.terraform_targets), '') != ''" | |
strategy: | |
fail-fast: false | |
matrix: | |
target: ${{fromJSON(needs.setup.outputs.terraform_targets)}} | |
env: | |
TFACTION_TARGET: ${{matrix.target.target}} | |
TFACTION_JOB_TYPE: terraform | |
steps: | |
- uses: actions/checkout@v3 | |
# We recommend using GitHub App Token instead of personal access token, | |
# but in this getting started let's use personal access token. | |
# - name: Generate token | |
# id: generate_token | |
# uses: tibdex/github-app-token@v1 | |
# with: | |
# app_id: ${{ secrets.APP_ID }} | |
# private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- uses: aquaproj/[email protected] | |
with: | |
aqua_version: v2.17.0 | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
with: | |
secrets: ${{ toJSON(secrets) }} | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
id: setup | |
with: | |
github_app_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
ssh_key: ${{ secrets.TERRAFORM_PRIVATE_MODULE_SSH_KEY }} # This isn't needed if you don't use SSH key to checkout private Terraform Modules | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
with: | |
github_app_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
- uses: suzuki-shunsuke/tfaction/[email protected] | |
with: | |
github_app_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
# This job is used for branch protection rule | |
# Add this job to `Status checks that are required` | |
status-check: | |
runs-on: ubuntu-latest | |
needs: [terraform-plan, tfmigrate-plan, setup] | |
if: failure() | |
steps: | |
- run: exit 1 |