Skip to content

Commit c705763

Browse files
authored
escape json string for atlantis workflow (#185)
1 parent b8e394b commit c705763

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/atlantis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
# Atlantis TG resource: https://github.com/Clever/k8-addons/blob/main/addons/atlantis/templates/atlantis-twingateresource.yaml
21-
#.TG connector: https://github.com/Clever/k8-addons/blob/main/addons/twingate/templates/default-twingateconnector.yaml
21+
# TG connector: https://github.com/Clever/k8-addons/blob/main/addons/twingate/templates/default-twingateconnector.yaml
2222
# TG operator config: https://github.com/Clever/k8s-terraform/blob/main/modules/addons/twingate.tf
2323
- name: Configure Twingate
2424
uses: twingate/github-action@v1
@@ -27,10 +27,13 @@ jobs:
2727
# call atlantis webhook: https://www.runatlantis.io/docs/configuring-webhooks
2828
- name: Call Atlantis
2929
timeout-minutes: 1
30+
env:
31+
# set github event to json as env variable to properly escape: https://github.com/actions/runner/issues/1656#issuecomment-1030077729
32+
GITHUB_EVENT_JSON: ${{ toJson(github.event) }}
3033
run: |
3134
curl --request POST \
3235
--header 'Content-Type: application/json' \
3336
--header 'X-GitHub-Event: ${{ github.event_name }}' \
3437
--header 'X-GitHub-Delivery: ${{ github.run_id }}' \
35-
--data '${{ toJson(github.event) }}' \
38+
--data "$GITHUB_EVENT_JSON" \
3639
${{ inputs.atlantis_url }}/events

0 commit comments

Comments
 (0)