hashicorp / hashicorp/tfc-workflows-github

Handle `post_plan_running` status in `apply-run`

Open
#2,986 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HCL
Stars
178
Forks
30
PR merge metrics
No merged PRs in 30d

Description

We have a GitHub action that uses the tooling from this repository that looks very similar to [this example](https://github.com/hashicorp/tfc-workflows-github/blob/main/actions/README.md).

```yaml
- uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.2
id: create-run
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ steps.upload.outputs.configuration_version_id }}

- uses: hashicorp/tfc-workflows-github/actions/apply-run@v1.3.2
# assign id attribute to reference in subsequent steps
id: apply
with:
run: ${{ steps.create-run.outputs.run_id }}
comment: "Confirmed from GitHub Actions CI"
```

Occasionally, we're observing the following in the `apply-run` step:

```
View Run in HCP Terraform: https://app.terraform.io/app//workspaces//runs/run-
run run-, cannot be applied
{
"run_id": "run-",
"run_link": "https://app.terraform.io/app//workspaces//runs/run-",
"run_status": "post_plan_running",
"status": "Error"
}
```

The workspace in question has Sentinel policies enabled. It looks like either `create-run` returns too early or `apply-run` needs to keep retrying until the `post_plan_running` state / Sentinel policies have passed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.