Skip to content

Commit

Permalink
Overwrite sha (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
zdmytriv authored Sep 5, 2023
1 parent ad3606c commit 0a29152
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
component-path:
description: "The path to the base component. Atmos defines this value as component_path."
required: true
sha:
description: "SHA to use"
required: true
default: "${{ github.event.pull_request.head.sha }}"
drift-detection-mode-enabled:
description: "Indicate whether this action is used in drift detection workflow."
required: true
Expand Down Expand Up @@ -119,7 +123,7 @@ runs:
component: ${{ inputs.component }}
stack: ${{ inputs.stack }}
settings-path: github.actions_enabled

- name: Check If GitHub Actions is Enabled For Component
shell: bash
run: |
Expand Down Expand Up @@ -150,7 +154,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 Down Expand Up @@ -212,7 +216,7 @@ runs:
with:
action: getPlan
planPath: "${{ steps.vars.outputs.plan_file }}.stored"
commitSHA: ${{ github.sha }}
commitSHA: ${{ inputs.sha }}
component: ${{ inputs.component }}
stack: ${{ inputs.stack }}
tableName: ${{ inputs.terraform-state-table }}
Expand Down Expand Up @@ -257,6 +261,7 @@ runs:
id: store-plan
with:
action: storePlan
commitSHA: ${{ inputs.sha }}
planPath: ${{ steps.vars.outputs.plan_file }}
component: ${{ inputs.component }}
stack: ${{ inputs.stack }}
Expand All @@ -268,6 +273,7 @@ runs:
uses: cloudposse/github-action-terraform-plan-storage@v1
with:
action: storePlan
commitSHA: ${{ inputs.sha }}
planPath: ${{ steps.vars.outputs.lock_file }}
component: ${{ inputs.component }}
stack: ${{ inputs.stack }}-lockfile
Expand Down Expand Up @@ -382,7 +388,7 @@ runs:
-var "component:${{ inputs.component }}" \
-var "stack:${{ inputs.stack }}" \
-var "componentPath:${{ inputs.component-path }}" \
-var "commitSHA:${{ github.sha }}" \
-var "commitSHA:${{ inputs.sha }}" \
-var "job:${{ github.job }}" \
-var "logoImage:${{ inputs.branding-logo-image }}" \
-var "logoUrl:${{ inputs.branding-logo-url }}" \
Expand Down

0 comments on commit 0a29152

Please sign in to comment.