Skip to content

Commit

Permalink
(FIX): CI Security Fix - branchname injection
Browse files Browse the repository at this point in the history
  • Loading branch information
glegendre01 authored Jan 29, 2025
1 parent 13dddbd commit 8aea930
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
uses: actions/checkout@v3

- id: set-matrix
env:
GITHUB_REF: ${{ github.ref }}
run: |
branchName=$(echo '${{ github.ref }}' | sed 's,refs/heads/,,g')
branchName=$(echo $GITHUB_REF | sed 's,refs/heads/,,g')
matrix=$(jq --arg branchName "$branchName" 'map(. | select((.runOn==$branchName) or (.runOn=="always")) )' .github/workflows/matrix.json)
echo "{\"include\":$(echo $matrix)}"
echo ::set-output name=matrix::{\"include\":$(echo $matrix)}\"
Expand Down

0 comments on commit 8aea930

Please sign in to comment.