Skip to content

Commit

Permalink
secrets cant be using in if syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
verbanicm committed Mar 2, 2023
1 parent 907407f commit 8b176ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/terraform-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' ' ')"
Expand Down

0 comments on commit 8b176ee

Please sign in to comment.