-
-
Notifications
You must be signed in to change notification settings - Fork 160
62 lines (53 loc) · 1.43 KB
/
test-ssh.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Test SSH Keys
on:
- pull_request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
ssh_key:
runs-on: ubuntu-latest
name: Git module source
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Plan
uses: ./terraform-plan
env:
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:
TERRAFORM_SSH_KEY: ${{ secrets.TERRAFORM_SSH_KEY }}
with:
path: tests/workflows/test-ssh
label: test-ssh ssh_key
- name: Verify outputs
run: |
if [[ "${{ steps.output.outputs.word }}" != "hello" ]]; then
echo "::error:: output not set correctly"
exit 1
fi
no_ssh_key:
runs-on: ubuntu-latest
name: Git module source with no key
steps:
- name: Checkout
uses: actions/checkout@v3
- 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
run: |
if [[ "${{ steps.plan.outcome }}" != "failure" ]]; then
echo "did not fail correctly with no SSH key"
exit 1
fi