From 486ba7c26b4d543af5986f39119faa9eb5172c93 Mon Sep 17 00:00:00 2001 From: Priyesh Mistry Date: Mon, 30 Dec 2024 14:13:23 +0000 Subject: [PATCH] feat: yaml linting --- .github/workflows/terraform-drift.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/terraform-drift.yml b/.github/workflows/terraform-drift.yml index fcc9a07..29ffb06 100644 --- a/.github/workflows/terraform-drift.yml +++ b/.github/workflows/terraform-drift.yml @@ -84,8 +84,8 @@ jobs: outputs: result-auth: ${{ steps.auth.outcome }} result-init: ${{ steps.init.outcome }} - result-plan: ${{ steps.plan.outcome }} - plan-stdout: ${{ steps.plan.outputs.stdout }} + result-validate: ${{ steps.validate.outcome }} + result-s3-backend-check: ${{ steps.s3-backend-check.outcome }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -118,9 +118,9 @@ jobs: uses: aws-actions/configure-aws-credentials@v4 with: aws-region: ${{ inputs.aws-region }} - mask-aws-account-id: "no" role-session-name: ${{ github.event.repository.name }} role-to-assume: arn:aws:iam::${{ inputs.aws-account-id }}:role/${{ steps.role.outputs.name }} + mask-aws-account-id: "no" - name: Set terraform-state-key variable id: state-key run: | @@ -158,22 +158,21 @@ jobs: - name: Check for drift and set status id: check-drift run: | - if grep -q 'No changes' <(terraform -chdir=${{ inputs.terraform-dir }} plan -var-file=$TF_VAR_FILE -no-color -input=false -out=tfplan -lock-timeout=${{ inputs.terraform-lock-timeout }}); then + if grep -q 'No changes' <(terraform -chdir=${{ inputs.terraform-dir }} plan -var-file=$TF_VAR_FILE -no-color -input=false -out=tfplan -lock-timeout=${{ inputs.terraform-lock-timeout }}); then echo "No drift detected." - echo "::set-output name=DRIFT_STATUS::no-drift" + echo "DRIFT_STATUS=no-drift" >> "$GITHUB_OUTPUT" else echo "Drift detected!" - echo "::set-output name=DRIFT_STATUS::drift" + echo "DRIFT_STATUS=drift" >> "$GITHUB_OUTPUT" exit 1 # Fail if drift is detected fi - name: Send Slack notification if drift is detected if: steps.check-drift.outputs.DRIFT_STATUS == 'drift' uses: slackapi/slack-github-action@v2.0.0 with: - webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook: ${{ secrets.slack-webhook-url }} payload: | { - "channel": "#${{ secrets.SLACK_CHANNEL }}", "username": "GitHub Actions", "text": "🚨 Drift Detected (${{ github.repository }})", "icon_emoji": ":warning:"