Skip to content

Commit

Permalink
fix: replace github.action_path with GITHUB_ACTION_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jul 16, 2024
1 parent 560de74 commit a0f260e
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions create-follow-up-pr/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ runs:
- uses: suzuki-shunsuke/tfaction/get-global-config@main
id: global-config

- run: bash ${{ github.action_path }}/skip_create_pr.sh
- run: bash "$GITHUB_ACTION_PATH/skip_create_pr.sh"
shell: bash
if: "fromJSON(steps.global-config.outputs.skip_create_pr)"
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
TFACTION_TARGET_LABEL_PREFIX: ${{ steps.global-config.outputs.label_prefix_target }}
TFACTION_DRAFT_PR: ${{ steps.global-config.outputs.draft_pr }}

- run: bash ${{ github.action_path }}/main.sh
- run: bash "$GITHUB_ACTION_PATH/main.sh"
shell: bash
if: "!fromJSON(steps.global-config.outputs.skip_create_pr)"
env:
Expand Down
6 changes: 3 additions & 3 deletions scaffold-tfmigrate/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ runs:
- name: Create .tfmigrate.hcl (S3)
run: |
if [ ! -f ".tfmigrate.hcl" ]; then
sed "s|%%TARGET%%|${TFACTION_TARGET}|g" ${{ github.action_path }}/tfmigrate.hcl |
sed "s|%%TARGET%%|${TFACTION_TARGET}|g" "$GITHUB_ACTION_PATH/tfmigrate.hcl" |
sed 's|%%S3_BUCKET_NAME_TFMIGRATE_HISTORY%%|${{steps.target-config.outputs.s3_bucket_name_tfmigrate_history}}|g' > .tfmigrate.hcl
fi
if: steps.target-config.outputs.s3_bucket_name_tfmigrate_history != ''
Expand All @@ -58,7 +58,7 @@ runs:
- name: Create .tfmigrate.hcl (GCS)
run: |
if [ ! -f ".tfmigrate.hcl" ]; then
sed "s|%%TARGET%%|${TFACTION_TARGET}|g" ${{ github.action_path }}/tfmigrate-gcs.hcl |
sed "s|%%TARGET%%|${TFACTION_TARGET}|g" "$GITHUB_ACTION_PATH/tfmigrate-gcs.hcl" |
sed 's|%%GCS_BUCKET_NAME_TFMIGRATE_HISTORY%%|${{steps.target-config.outputs.gcs_bucket_name_tfmigrate_history}}|g' > .tfmigrate.hcl
fi
if: steps.target-config.outputs.gcs_bucket_name_tfmigrate_history != ''
Expand All @@ -70,7 +70,7 @@ runs:
working-directory: ${{steps.target-config.outputs.working_directory}}

- name: Create a migration file
run: sed "s|%%MIGRATION_NAME%%|${{inputs.migration_name}}|g" ${{ github.action_path }}/migration.hcl > "tfmigrate/$(date +%Y%m%d%H%M%S)_${{inputs.migration_name}}.hcl"
run: sed "s|%%MIGRATION_NAME%%|${{inputs.migration_name}}|g" "$GITHUB_ACTION_PATH/migration.hcl" > "tfmigrate/$(date +%Y%m%d%H%M%S)_${{inputs.migration_name}}.hcl"
shell: bash
working-directory: ${{steps.target-config.outputs.working_directory}}

Expand Down
4 changes: 2 additions & 2 deletions scaffold-working-dir/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ runs:
shell: bash
working-directory: ${{steps.target-config.outputs.working_directory}}

- run: cp ${{ github.action_path }}/tfmigrate.hcl .tfmigrate.hcl
- run: cp "$GITHUB_ACTION_PATH/tfmigrate.hcl" .tfmigrate.hcl
if: steps.target-config.outputs.s3_bucket_name_tfmigrate_history != ''
shell: bash
working-directory: ${{steps.target-config.outputs.working_directory}}
- run: cp ${{ github.action_path }}/tfmigrate-gcs.hcl .tfmigrate.hcl
- run: cp "$GITHUB_ACTION_PATH/tfmigrate-gcs.hcl" .tfmigrate.hcl
if: steps.target-config.outputs.gcs_bucket_name_tfmigrate_history != ''
shell: bash
working-directory: ${{steps.target-config.outputs.working_directory}}
Expand Down
2 changes: 1 addition & 1 deletion setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ runs:
with:
ssh_key: ${{ inputs.ssh_key }}

- uses: suzuki-shunsuke/github-action-terraform-init@71673ab29266f67c4470773675e087e9a4dda3c5 # v1.1.0
- uses: suzuki-shunsuke/github-action-terraform-init@29c2316e647f5785788b0a049d11a12c6d615fda # v1.1.1-1
with:
working_directory: ${{ steps.target-config.outputs.working_directory }}
github_token: ${{ inputs.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion terraform-apply/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
pr_author: ${{ env.CI_INFO_PR_AUTHOR }}
skip_label_prefix: ${{ steps.global-config.outputs.label_prefix_skip }}

- run: bash ${{ github.action_path }}/main.sh
- run: bash "$GITHUB_ACTION_PATH/main.sh"
id: apply
working-directory: ${{ steps.target-config.outputs.working_directory }}
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion terraform-plan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
labels: ${{ env.CI_INFO_TEMP_DIR }}/labels.txt
pr_author: ${{ env.CI_INFO_PR_AUTHOR }}
skip_label_prefix: ${{ steps.global-config.outputs.label_prefix_skip }}
- run: bash ${{ github.action_path }}/main.sh
- run: bash "$GITHUB_ACTION_PATH/main.sh"
working-directory: ${{ steps.target-config.outputs.working_directory }}
shell: bash
if: |
Expand Down
2 changes: 1 addition & 1 deletion test-module/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
GITHUB_TOKEN: ${{ inputs.github_token }}
run: bash "${GITHUB_ACTION_PATH}/terraform-docs.sh"

- uses: suzuki-shunsuke/github-action-terraform-fmt@388ce9deea65edd9a9a3a60bee140732c3dad7a2 # v0.2.1
- uses: suzuki-shunsuke/github-action-terraform-fmt@c7378a5b9d2311278db9a7ef825ee6ad6697078c # v0.2.2-1
with:
working_directory: ${{ env.TFACTION_TARGET }}
github_token: ${{ inputs.github_token }}
Expand Down
2 changes: 1 addition & 1 deletion test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ runs:
working_directory: ${{ steps.target-config.outputs.working_directory }}
github_comment: "true"

- uses: suzuki-shunsuke/github-action-terraform-fmt@388ce9deea65edd9a9a3a60bee140732c3dad7a2 # v0.2.1
- uses: suzuki-shunsuke/github-action-terraform-fmt@c7378a5b9d2311278db9a7ef825ee6ad6697078c # v0.2.2-1
if: steps.target-config.outputs.destroy != 'true'
with:
working_directory: ${{ steps.target-config.outputs.working_directory }}
Expand Down
2 changes: 1 addition & 1 deletion tfmigrate-apply/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
- uses: suzuki-shunsuke/tfaction/get-target-config@main
id: target-config

- run: bash ${{ github.action_path }}/main.sh
- run: bash "$GITHUB_ACTION_PATH/main.sh"
id: apply
working-directory: ${{ steps.target-config.outputs.working_directory }}
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion tfmigrate-plan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
id: global-config
- uses: suzuki-shunsuke/tfaction/get-target-config@main
id: target-config
- run: bash ${{ github.action_path }}/main.sh
- run: bash "$GITHUB_ACTION_PATH/main.sh"
working-directory: ${{ steps.target-config.outputs.working_directory }}
shell: bash
env:
Expand Down
2 changes: 1 addition & 1 deletion update-drift-issue/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
- uses: suzuki-shunsuke/tfaction/get-global-config@main
id: global-config
- name: Post a comment
run: bash ${{ github.action_path }}/post-comment.sh
run: bash "$GITHUB_ACTION_PATH/post-comment.sh"
shell: bash
if: |
inputs.status != 'success' && env.TFACTION_DRIFT_ISSUE_NUMBER
Expand Down

0 comments on commit a0f260e

Please sign in to comment.