Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed version for plan storage step and added overwrite SHA #19

Merged
merged 10 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ inputs:
component-path:
description: "The path to the base component. Atmos defines this value as component_path."
required: true
commit-sha:
sha:
description: "Commit SHA to apply. Default: github.sha"
required: true
default: "${{ github.sha }}"
default: "${{ github.event.pull_request.head.sha }}"
terraform-apply-role:
description: "The AWS role to be used to apply Terraform."
required: true
Expand Down Expand Up @@ -147,7 +147,7 @@ runs:
STACK_NAME=$(echo "${{ inputs.stack }}" | sed 's#/#_#g')
COMPONENT_NAME=$(echo "${{ inputs.component }}" | sed 's#/#_#g')
COMPONENT_SLUG="$STACK_NAME-$COMPONENT_NAME"
PLAN_FILE="$GITHUB_WORKSPACE/${{ inputs.component-path}}/$COMPONENT_SLUG-${{ github.sha }}.planfile"
PLAN_FILE="$GITHUB_WORKSPACE/${{ inputs.component-path}}/$COMPONENT_SLUG-${{ inputs.sha }}.planfile"
LOCK_FILE="$GITHUB_WORKSPACE/${{ inputs.component-path}}/.terraform.lock.hcl"

echo "stack_name=$STACK_NAME" >> $GITHUB_OUTPUT
Expand All @@ -167,32 +167,32 @@ runs:

- name: Retrieve Plan
if: env.ACTIONS_ENABLED == 'true'
uses: cloudposse/github-action-terraform-plan-storage@added-commitsha-overwrite-input
uses: cloudposse/github-action-terraform-plan-storage@v1
id: retrieve-plan
continue-on-error: true
with:
action: getPlan
planPath: ${{ steps.vars.outputs.plan_file }}
commitSHA: ${{ inputs.commit-sha }}
commitSHA: ${{ inputs.sha }}
component: ${{ inputs.component }}
stack: ${{ inputs.stack }}
tableName: ${{ inputs.terraform-state-table }}
bucketName: ${{ inputs.terraform-state-bucket }}

- name: Retrieve Lockfile
if: env.ACTIONS_ENABLED == 'true'
uses: cloudposse/github-action-terraform-plan-storage@added-commitsha-overwrite-input
uses: cloudposse/github-action-terraform-plan-storage@v1
continue-on-error: true
with:
action: getPlan
planPath: ${{ steps.vars.outputs.lock_file }}
commitSHA: ${{ inputs.commit-sha }}
commitSHA: ${{ inputs.sha }}
component: ${{ inputs.component }}
stack: "${{ inputs.stack }}-lockfile"
tableName: ${{ inputs.terraform-state-table }}
bucketName: ${{ inputs.terraform-state-bucket }}

- name: Configure Apply AWS Credentials
- name: Configure AWS Credentials
if: env.ACTIONS_ENABLED == 'true'
uses: aws-actions/[email protected]
with:
Expand Down