Skip to content

Commit

Permalink
feat: upload artifact retention period (#415)
Browse files Browse the repository at this point in the history
Signed-off-by: Rishav Dhar <[email protected]>
  • Loading branch information
rdhar authored Feb 5, 2025
1 parent cc5b270 commit db1b947
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ For each workflow run, a matrix-friendly job summary with logs is added as a fal
| Check | `validate` | Check validation of TF code.</br>Default: `false` |
| Check | `plan-parity` | Replace plan file if it matches a newly-generated one to prevent stale apply.<sup>2</sup></br>Default: `false` |
| Security | `plan-encrypt` | Encrypt plan file artifact with the given input.<sup>3</sup></br>Example: `${{ secrets.PASSPHRASE }}` |
| Security | `retention-days` | Duration after which plan file artifact will expire in days.</br>Example: `90` |
| Security | `token` | Specify a GitHub token.</br>Default: `${{ github.token }}` |
| UI | `label-pr` | Add a PR label with the command input (e.g., `tf:plan`).</br>Default: `true` |
| UI | `comment-pr` | Add a PR comment: `always`, `on-change`, or `never`.<sup>4</sup></br>Default: `always` |
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ runs:
with:
name: ${{ steps.identifier.outputs.name }}
path: ${{ format('{0}{1}tfplan', inputs.arg-chdir || inputs.working-directory, (inputs.arg-chdir || inputs.working-directory) && '/' || '') }}
retention-days: ${{ inputs.retention-days }}
overwrite: true

- if: ${{ inputs.command == 'plan' && github.server_url != 'https://github.com' }}
Expand All @@ -239,6 +240,7 @@ runs:
with:
name: ${{ steps.identifier.outputs.name }}
path: ${{ format('{0}{1}tfplan', inputs.arg-chdir || inputs.working-directory, (inputs.arg-chdir || inputs.working-directory) && '/' || '') }}
retention-days: ${{ inputs.retention-days }}

- if: ${{ inputs.plan-parity == 'true' && steps.download.outcome == 'success' }}
shell: bash
Expand Down Expand Up @@ -494,6 +496,10 @@ inputs:
default: "false"
description: "Replace the plan file if it matches a newly-generated one to prevent stale apply (e.g., `false`)."
required: false
retention-days:
default: ""
description: "Duration after which plan file artifact will expire in days (e.g., '90')."
required: false
show-args:
default: "workspace"
description: "Show comma-separated arguments in the command input (e.g., `workspace`)."
Expand Down

0 comments on commit db1b947

Please sign in to comment.