Skip to content

Commit

Permalink
chore: giving work dir specific names
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-chris committed Dec 28, 2023
1 parent 7a49471 commit 6284bb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/actions/tf-apply/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ inputs:
runs:
using: "composite"
steps:
- name: Get last directory name
id: get-tf-dir
run: |
tf-dir=$(echo ${{ inputs.terraform_directory }} | rev | cut -d'/' -f1 | rev)
echo "Last directory name is: $last_dir"
shell: bash

- name: Set Terraform Variables
run: |
if [[ -n "${INPUT_TF_VARS}" ]]; then
Expand Down Expand Up @@ -78,7 +85,7 @@ runs:
github_token: ${{ inputs.github_token }}
workflow: ${{ inputs.plan_workflow_file }}
pr: ${{ inputs.pr_id }}
name: ${{ inputs.terraform_directory }}/${{ inputs.pr_id }}-tf-plan
name: ${{ inputs.pr_id }}-${{ steps.get-tf-dir.outputs.tf-dir }}-tf-plan
path: ${{ inputs.terraform_directory }}

# - name: Terraform Apply
Expand Down
9 changes: 8 additions & 1 deletion .github/actions/tf-plan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ inputs:
runs:
using: "composite"
steps:
- name: Get last directory name
id: get-tf-dir
run: |
tf-dir=$(echo ${{ inputs.terraform_directory }} | rev | cut -d'/' -f1 | rev)
echo "Last directory name is: $last_dir"
shell: bash

- name: Set Terraform Variables
run: |
if [[ -n "${INPUT_TF_VARS}" ]]; then
Expand Down Expand Up @@ -85,7 +92,7 @@ runs:
id: save-artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.terraform_directory }}/${{ inputs.pr_id }}-tf-plan
name: ${{ inputs.pr_id }}-${{ steps.get-tf-dir.outputs.tf-dir }}-tf-plan
path: ${{ inputs.terraform_directory }}/tfplan

- name: Comment Plan
Expand Down

0 comments on commit 6284bb6

Please sign in to comment.