Remedy risk of template code injection

This commit is contained in:
Danny Mösch
2025-08-30 13:36:30 +02:00
parent d5ad845db7
commit 96df29d72c
5 changed files with 17 additions and 8 deletions
+3 -1
View File
@@ -24,4 +24,6 @@ runs:
echo "CC=clang" >> $GITHUB_ENV
- name: Build SwiftLint with Bazel
shell: bash
run: bazel build --config release ${{ inputs.target }}
run: bazel build --config release ${INPUTS_TARGET}
env:
INPUTS_TARGET: ${{ inputs.target }}
+3 -1
View File
@@ -10,10 +10,12 @@ runs:
steps:
- run: |
awk '
$0 ~ "${{ inputs.rule }}:" { in_rule = 1; next }
$0 ~ "${INPUTS_RULE}:" { in_rule = 1; next }
in_rule && /^\t/ { print $0 }
in_rule && !/^\t/ { in_rule = 0 }
' Makefile | while IFS= read -r command; do
eval "$command"
done
shell: bash
env:
INPUTS_RULE: ${{ inputs.rule }}
+3 -1
View File
@@ -31,8 +31,10 @@ jobs:
- name: Retrieve author in uppercase
id: retrieve_author
run: |
AUTHOR=$(echo ${{ inputs.actor }} | tr '[:lower:]' '[:upper:]')
AUTHOR=$(echo "${INPUTS_ACTOR}" | tr '[:lower:]' '[:upper:]')
echo "name=${AUTHOR}" >> "$GITHUB_OUTPUT"
env:
INPUTS_ACTOR: ${{ inputs.actor }}
- name: Configure Git author
id: configure_git_author
uses: Homebrew/actions/git-user-config@master
+3 -2
View File
@@ -40,13 +40,14 @@ jobs:
} >> "$GITHUB_OUTPUT"
else
{
echo "checkout-ref=${{ inputs.tag }}"
echo "docker-tag=${{ inputs.tag }}"
echo "checkout-ref=${INPUTS_TAG}"
echo "docker-tag=${INPUTS_TAG}"
} >> "$GITHUB_OUTPUT"
fi
echo "repository-lc=${REPOSITORY,,}" >> "$GITHUB_OUTPUT"
env:
REPOSITORY: ${{ github.repository }}
INPUTS_TAG: ${{ inputs.tag }}
build-amd64:
name: Build AMD64 Image
+5 -3
View File
@@ -31,10 +31,12 @@ jobs:
token: ${{ secrets[format('PERSONAL_GITHUB_TOKEN_{0}', needs.setup-credentials.outputs.author_uppercase)] }}
- name: Merge release branch
run: |
git fetch origin release/${{ github.event.release.tag_name }}
git merge --ff-only origin/release/${{ github.event.release.tag_name }}
git fetch origin "release/${TAG_NAME}"
git merge --ff-only "origin/release/${TAG_NAME}"
git push origin main
git push origin --delete release/${{ github.event.release.tag_name }}
git push origin --delete "release/${TAG_NAME}"
env:
TAG_NAME: ${{ github.event.release.tag_name }}
publish-pod:
name: Publish Pod