From 8b176ee249dcd4a4aa6c0078d80015afbcc96ecf Mon Sep 17 00:00:00 2001 From: Mike Verbanic Date: Thu, 2 Mar 2023 10:43:02 -0500 Subject: [PATCH] secrets cant be using in if syntax --- .github/workflows/terraform-lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-lint.yml b/.github/workflows/terraform-lint.yml index 0fcf6fb7..d5aa73c0 100644 --- a/.github/workflows/terraform-lint.yml +++ b/.github/workflows/terraform-lint.yml @@ -42,17 +42,17 @@ jobs: run: |- terraform fmt -recursive -check -diff + # secrets cannot be used for conditional `if` for steps, default to github.token - name: 'Set Git Credentials' - if: ${{ secrets.workflow_github_token }} shell: 'bash' run: |- - git config --global url."https://terraform-lint:${{ secrets.workflow_github_token }}@github.com".insteadOf "https://github.com" + git config --global url."https://terraform-lint:${{ secrets.workflow_github_token || github.token }}@github.com".insteadOf "https://github.com" - name: 'Initialize and validate' shell: 'bash' working-directory: '${{ inputs.directory }}' env: - GITHUB_TOKEN: '${{ secrets.workflow_github_token }}' + GITHUB_TOKEN: '${{ secrets.workflow_github_token || github.token }}' run: |- TERRAFORM_DIRS="$(find . -name '*.tf' -printf "%h\n" | sort -u | tr '\n' ' ')"