Skip to content

Plan stale when applying PR that only changes the lock file #1529

Discussion options

You must be logged in to vote

the lock file means .terraform.lock.hcl, right?

After merging apply failed and said the plan is stale.

tfaction stores the plan file at GitHub Artifacts and uses it when running terraform apply.

https://suzuki-shunsuke.github.io/tfaction/docs/feature/plan-file

#!/usr/bin/env bash
set -euo pipefail
filename=tfplan.binary
artifact_name=terraform_plan_file_${TFACTION_TARGET//\//__}
branch=$CI_INFO_HEAD_REF
workflow=$PLAN_WORKFLOW_NAME
pr_head_sha=$(jq -r ".head.sha" "$CI_INFO_TEMP_DIR/pr.json")
body=$(gh run list -w "$workflow" -b "$branch" -L 1 --json …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@florianmutter
Comment options

Answer selected by florianmutter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants