Skip to content

Commit 8653507

Browse files
authored
GH actions: do not interpolate template variables in run blocks. (#1284)
- Prevents injection of code during CI build.
1 parent 50b4c30 commit 8653507

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

.github/workflows/common.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ jobs:
4949
DEVELOPER_DIR: "/Applications/Xcode-latest.app/Contents/Developer"
5050

5151
- name: Set build configuration
52+
env:
53+
RELEASE: ${{ inputs.release }}
5254
run: |
5355
echo "BUILD_CONFIGURATION=debug" >> $GITHUB_ENV
54-
if [[ "${{ inputs.release }}" == "true" ]]; then
56+
if [[ "${RELEASE}" == "true" ]]; then
5557
echo "BUILD_CONFIGURATION=release" >> $GITHUB_ENV
5658
fi
5759
@@ -65,8 +67,8 @@ jobs:
6567
- name: Create package
6668
run: |
6769
mkdir -p outputs
68-
mv bin/${{ env.BUILD_CONFIGURATION }}/container-installer-unsigned.pkg outputs
69-
mv bin/${{ env.BUILD_CONFIGURATION }}/bundle/container-dSYM.zip outputs
70+
mv "bin/${BUILD_CONFIGURATION}/container-installer-unsigned.pkg" outputs
71+
mv "bin/${BUILD_CONFIGURATION}/bundle/container-dSYM.zip" outputs
7072
7173
- name: Test the container project
7274
run: |

.github/workflows/docs-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') || startsWith(github.ref, 'refs/heads/release')
1515
steps:
1616
- name: Branch validation
17-
run: echo "Branch ${{ github.ref_name }} is allowed"
17+
env:
18+
REF_NAME: ${{ github.ref_name }}
19+
run: echo "Branch ${REF_NAME} is allowed"
1820

1921
buildSite:
2022
name: Build application website

.github/workflows/pr-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ jobs:
1515
- name: Check all commits are signed
1616
env:
1717
GH_TOKEN: ${{ github.token }}
18+
REPO: ${{ github.repository }}
19+
PR_NUMBER: ${{ github.event.pull_request.number }}
1820
run: |
19-
commits=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits --paginate)
21+
commits=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/commits" --paginate)
2022
unsigned_commits=""
2123
2224
while IFS='|' read -r sha author verified; do

.github/workflows/pr-label-analysis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ jobs:
1414

1515
steps:
1616
- name: Save PR metadata
17+
env:
18+
PR_NUMBER: ${{ github.event.pull_request.number }}
1719
run: |
1820
mkdir -p ./pr-metadata
19-
echo "${{ github.event.pull_request.number }}" > ./pr-metadata/pr-number.txt
21+
echo "${PR_NUMBER}" > ./pr-metadata/pr-number.txt
2022
2123
- name: Upload PR metadata as artifact
2224
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6

0 commit comments

Comments
 (0)