# Stage Age & Github Actions

**URL:** <https://discuss.hashicorp.com/t/stage-age-github-actions/71057>\
**Category:** Terraform\
**Created:** [October 31, 2024, 5:07pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057 "2024-10-31T17:07:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlindes](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mlindes/32/3405_2.png) [@mlindes](https://discuss.hashicorp.com/u/mlindes)\
**Post date:** [October 31, 2024, 5:07pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/1 "2024-10-31T17:07:38Z")

</div>

I have to use github actions for a terraform plan/apply - which isn’t ideal since there isn’t an option in GHA to take user input. My ideal flow, as I’ve used with other CICD tools, is to:

- trigger a terraform plan (write plan to file)
- pause/prompt the user for input (apply plan?)
- tf apply the plan (with plan file (if user approved))

In GHA, I have one workflow to run a tf plan & save the plan file as artifact. Then a 2nd workflow to pull that artifact & apply the plan.

I’m mostly curious to know how old a plan can be be and if I should do some additional checking on this… like, don’t apply if the plan is older than 10 minutes… or some logic. Is this needed or can I rely on TF to check that the state is stale?

Otherwise, since it’s GHA, if you have any good patterns for tf plan/apply, I’m open.

---

<div class="post-metadata">

**Author:** ![wyardley](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wyardley/32/21845_2.png) [@wyardley](https://discuss.hashicorp.com/u/wyardley)\
**Post date:** [October 31, 2024, 10:46pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/2 "2024-10-31T22:46:09Z")

</div>

I haven’t used GHA to deploy Terraform code, but would it work to use [deployment approval](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/reviewing-deployments)?

---

<div class="post-metadata">

**Author:** ![mlindes](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/mlindes/32/3405_2.png) [@mlindes](https://discuss.hashicorp.com/u/mlindes)\
**Post date:** [November 1, 2024, 2:56pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/3 "2024-11-01T14:56:17Z")

</div>

Thanks for the suggestion. But that looks like a gatekeeping method more than anything. GHA just isn’t intended to have any workflow interaction - all inputs are up front.  
I think I’m stuck with what I have… which is just one workflow with 3 steps.

- tf-plan (stash plan file as artifact)
- verify (pull artifact; verify artifact is not older than 10 mins; sleep for a few mins to give the user time to review the plan & cancel the workflow)
- tf-apply

Verifying the age of the tf-plan artifact may not be necessary, but doesn’t hurt.

---

<div class="post-metadata">

**Author:** ![wendellbarc](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wendellbarc/32/43629_2.png) [@wendellbarc](https://discuss.hashicorp.com/u/wendellbarc)\
**Post date:** [November 1, 2024, 5:57pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/4 "2024-11-01T17:57:13Z")

</div>

Hi,  
Just to mention,  
Currently at our company we’re using Atlantis ([runatlantis.io](http://runatlantis.io)), which allows you to interact in GitHub with inputs like plan/import/apply.  
For our case, it worked well. It might be worth checking out.

---

<div class="post-metadata">

**Author:** ![wyardley](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wyardley/32/21845_2.png) [@wyardley](https://discuss.hashicorp.com/u/wyardley)\
**Post date:** [November 1, 2024, 7:15pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/5 "2024-11-01T19:15:58Z")

</div>

I thought it’s possible to use inputs for manual input runs ([Manually running a workflow - GitHub Docs](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/manually-running-a-workflow)), though haven’t used that functionality in GHA myself.

I guess my point was, if you have a plan step upstream, then the deploy step (with approval) downstream, you could avoid applying by not approving the workflow, so you wouldn’t need any manual input in the GitHub Actions workflow itself. So yes, it would be gatekeeping only, and of course you’d need to revert the change or roll forward to avoid having things in a broken state, but might work in a pinch.

---

<div class="post-metadata">

**Author:** ![wyardley](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wyardley/32/21845_2.png) [@wyardley](https://discuss.hashicorp.com/u/wyardley)\
**Post date:** [November 1, 2024, 7:16pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/6 "2024-11-01T19:16:25Z")

</div>

Yes, I’ve also used Atlantis, and there are some other similar tools that are great.

From what the OP said in the first post, I assumed using one of these tools was not an option.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/hashicorp/original/1X/79bf76adfd92a75631996933098f9ce29d37abf3.svg) [@system](https://discuss.hashicorp.com/u/system)\
**Post date:** [April 30, 2025, 7:17pm UTC](https://discuss.hashicorp.com/t/stage-age-github-actions/71057/7 "2025-04-30T19:17:06Z")

</div>

Closed on April 30, 2025, 7:17pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
