Skip to content

Commit

Permalink
Expressions in GHA env variables are purposefully not expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Dec 18, 2024
1 parent 49450bc commit 6dca3db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
expected: |-
#!/usr/bin/env bash
set -e
# shellcheck disable=SC2034
# shellcheck disable=SC2016,SC2034
greeting='Hello'
# shellcheck disable=SC2034
# shellcheck disable=SC2016,SC2034
name='Integration Tests'
# ---
echo ":env.greeting:, $name"
2 changes: 1 addition & 1 deletion gha_extract_shell_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def process_workflow_file(workflow_path: Path, output_dir: Path, ignored_errors=
elif shell == "bash":
f.write("set -eo pipefail\n")
for k, v in env.items():
f.write("# shellcheck disable=SC2034\n")
f.write("# shellcheck disable=SC2016,SC2034\n")
v = sanitize_gha_expression(str(v)).replace("'", "'\\''")
f.write(f"{k}='{v}'\n")
f.write("# ---\n")
Expand Down

0 comments on commit 6dca3db

Please sign in to comment.