Skip to content

Commit 64928c4

Browse files
authored
Escape ansible variables properly to ensure that ' is handled properly (#35)
1 parent 76d10b4 commit 64928c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/run.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,10 @@ jobs:
2929
sudo apt update && \
3030
sudo apt install gh
3131
- name: Run playbook
32-
run: ansible-playbook playbook/playbook.yaml --extra-vars "gh_access_token=${{ secrets.gh_access_token }} base_dir=$(pwd) commit_hash=${{ github.sha }} original_commit_message='${{ github.event.head_commit.message }}'"
32+
run: |
33+
# Funnel via JSON to ensure that values are escaped properly
34+
echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, original_commit_message: $ENV.COMMIT_MESSAGE, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
35+
ansible-playbook playbook/playbook.yaml --extra-vars "@vars.json"
36+
env:
37+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
38+
GH_ACCESS_TOKEN: ${{ secrets.gh_access_token }}

0 commit comments

Comments
 (0)