github-comment: command not found error when running list-targets #991
-
tfaction versionv0.6.1 Environment
OverviewI'm trying to run a terraform-plan using GitHub actions as showed in examples. It is failing at step
with error: What am I doing wrong?? How to reproducetfaction-root.yaml ---
target_groups:
- working_directory: domains/infrastructure
target: domains/infrastructure
gcs_bucket_name_tfmigrate_history: "tfaction-tf-plan-files"
gcs_bucket_name_plan_file: "tfaction-tf-plan-files"
terraform_plan_config:
gcp_service_account: [email protected]
gcp_workload_identity_provider: "projects/redacted/locations/global/workloadIdentityPools/github-actions/providers/github-actions"
tfaction.yaml File not created GitHub Actions Workflow name: terraform plan test
on: [push]
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:
terraform_targets: ${{ steps.list-targets.outputs.terraform_targets }}
steps:
- uses: actions/checkout@v3
- uses: aquaproj/[email protected]
with:
aqua_version: v2.8.0
- uses: suzuki-shunsuke/tfaction/[email protected]
id: list-targets
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.8.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, setup]
if: failure()
steps:
- run: exit 1
Other related code such as local Registry
GitHub Actions' log
Expected behaviourthe step works successfully and CI moves to Actual behaviourerroring in the step - uses: suzuki-shunsuke/tfaction/[email protected]
id: list-targets Important FactoidsNo response Reference |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please check aqua.yaml at the repository root. e.g. https://github.com/suzuki-shunsuke/tfaction-example/blob/main/aqua.yaml github-comment should be installed by aqua. ref. https://suzuki-shunsuke.github.io/tfaction/docs/config/aqua |
Beta Was this translation helpful? Give feedback.
Please check aqua.yaml at the repository root.
e.g.
https://github.com/suzuki-shunsuke/tfaction-example/blob/main/aqua.yaml
https://github.com/suzuki-shunsuke/tfaction-example/blob/main/aqua/github-comment.yaml
github-comment should be installed by aqua.
ref. https://suzuki-shunsuke.github.io/tfaction/docs/config/aqua