diff --git a/action.yml b/action.yml index df1f9665b..03a1ec08e 100644 --- a/action.yml +++ b/action.yml @@ -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 @@ -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: | @@ -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 @@ -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 }} @@ -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 }} @@ -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 @@ -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 }}" \