Improve parsing of tf files #603
Workflow file for this run
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
name: Test actions using SSH Keys | |
on: | |
- pull_request | |
permissions: | |
contents: read | |
jobs: | |
ssh_key: | |
runs-on: ubuntu-24.04 | |
name: Git module source | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Plan | |
uses: ./terraform-plan | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TERRAFORM_SSH_KEY: ${{ secrets.TERRAFORM_SSH_KEY }} | |
with: | |
path: tests/workflows/test-ssh | |
label: test-ssh ssh_key | |
- name: Apply | |
uses: ./terraform-apply | |
id: output | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TERRAFORM_SSH_KEY: ${{ secrets.TERRAFORM_SSH_KEY }} | |
with: | |
path: tests/workflows/test-ssh | |
label: test-ssh ssh_key | |
- name: Verify outputs | |
env: | |
WORD: ${{ steps.output.outputs.word }} | |
run: | | |
if [[ "$WORD" != "hello" ]]; then | |
echo "::error:: output not set correctly" | |
exit 1 | |
fi | |
no_ssh_key: | |
runs-on: ubuntu-24.04 | |
name: Git module source with no key | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Plan | |
uses: ./terraform-plan | |
continue-on-error: true | |
id: plan | |
with: | |
path: tests/workflows/test-ssh | |
label: test-ssh no_ssh_key | |
add_github_comment: false | |
- name: Check failed | |
env: | |
OUTCOME: ${{ steps.plan.outcome }} | |
run: | | |
if [[ "$OUTCOME" != "failure" ]]; then | |
echo "did not fail correctly with no SSH key" | |
exit 1 | |
fi |