-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,31 +128,31 @@ runs: | |
- name: Test | ||
shell: bash | ||
run: | | ||
echo "${{ fromJson(steps.component.outputs.settings).enabled == 'true' }}" | ||
echo "${{ fromJson(steps.component.outputs.settings).component-path }}" | ||
- name: Set atmos cli base path vars | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
shell: bash | ||
run: |- | ||
# Set ATMOS_BASE_PATH allow `cloudposse/utils` provider to read atmos config from the correct path | ||
ATMOS_BASE_PATH="${{ fromJson(steps.component.outputs.settings).base-path }}" | ||
echo "ATMOS_BASE_PATH=$(realpath ${ATMOS_BASE_PATH:-./})" >> $GITHUB_ENV | ||
- name: Install tfcmt | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
repo: suzuki-shunsuke/tfcmt | ||
tag: v4.11.0 | ||
|
||
- name: Prepare Artifacts Directory | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
shell: bash | ||
run: | | ||
mkdir -p metadata | ||
- name: Define Job Variables | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
id: vars | ||
shell: bash | ||
run: | | ||
|
@@ -181,7 +181,7 @@ runs: | |
echo "issue_file=${ISSUE_SUMMARY_FILE}" >> $GITHUB_OUTPUT | ||
- name: Configure Plan AWS Credentials | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
uses: aws-actions/[email protected] | ||
with: | ||
aws-region: ${{ steps.config.outputs.aws-region }} | ||
|
@@ -192,14 +192,14 @@ runs: | |
- name: Cache .terraform | ||
id: cache | ||
uses: actions/cache@v4 | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
with: | ||
path: | | ||
./${{ steps.vars.outputs.component_path }}/.terraform | ||
key: ${{ steps.vars.outputs.cache-key }} | ||
|
||
- name: Atmos Terraform Plan | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
id: atmos-plan | ||
shell: bash | ||
run: | | ||
|
@@ -367,7 +367,7 @@ runs: | |
- name: Store Component Metadata to Artifacts | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' && inputs.drift-detection-mode-enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled && inputs.drift-detection-mode-enabled == 'true' }} | ||
shell: bash | ||
run: | | ||
echo -n '{ "stack": "${{ inputs.stack }}", "component": "${{ inputs.component }}", "componentPath": "${{ steps.vars.outputs.component_path }}", "drifted": '"${{ steps.atmos-plan.outputs.changes }}"', "error": '"${{ steps.atmos-plan.outputs.error }}"' }' > "metadata/${{ steps.vars.outputs.component_slug }}.metadata.json" | ||
|
@@ -411,7 +411,7 @@ runs: | |
echo "rand=$(openssl rand -hex 5)" >> "$GITHUB_OUTPUT" | ||
- name: Upload Artifacts | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' && inputs.drift-detection-mode-enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled && inputs.drift-detection-mode-enabled == 'true' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# The name of the artifact needs to be unique for every job run! | ||
|
@@ -421,7 +421,7 @@ runs: | |
retention-days: ${{ inputs.metadata-retention-days }} | ||
|
||
- name: Exit status | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled == 'true' }} | ||
if: ${{ fromJson(steps.component.outputs.settings).enabled }} | ||
shell: bash | ||
run: | | ||
exit ${{ steps.atmos-plan.outputs.result }} |