Skip to content

Commit

Permalink
CI: escape various inputs
Browse files Browse the repository at this point in the history
Shouldn't make a difference since all is trusted, but why not.

In the case of the PKGBUILD reusable workflow ignore the error since
we need to pass unescaped commands to it for testing.
  • Loading branch information
lazka committed Dec 6, 2024
1 parent 1076ee4 commit 4326ccb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/PKGBUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ jobs:
pacboy: toolchain:p

- name: '🚧 Build package'
env:
PKGBUILD_PATH: ${{ inputs.path }}
run: |
cd ${{ inputs.path }}
cd "$PKGBUILD_PATH"
makepkg-mingw --noconfirm --noprogressbar -sCLf
- name: '📤 Upload artifact: package'
Expand All @@ -67,10 +69,12 @@ jobs:
path: ${{ inputs.path }}/*.zst

- name: '🔍 Show package content'
env:
PKGBUILD_PATH: ${{ inputs.path }}
run: |
mkdir tmp
cd tmp
tar -xf ../${{ inputs.path }}/*.zst
tar -xf ../"$PKGBUILD_PATH"/*.zst
tree .
Expand Down Expand Up @@ -103,4 +107,4 @@ jobs:
run: pacman -U --noconfirm --noprogressbar *.zst

- name: '🚦 Test package'
run: ${{ inputs.test }}
run: ${{ inputs.test }} # zizmor: ignore[template-injection]
10 changes: 7 additions & 3 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,14 +454,18 @@ jobs:
run: |
cygpath -m /
- shell: pwsh
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
run: |
echo '${{ steps.msys2.outputs.msys2-location }}'
echo "$env:MSYS2_LOCATION"
- shell: pwsh
env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
run: |
$Env:MSYS2_ROOT = msys2 -c 'cygpath -a -w /'
$Env:MSYS2_ROOT
if ($env:MSYS2_ROOT -ne '${{ steps.msys2.outputs.msys2-location }}') {
Write-Error "Error: MSYS2_ROOT is '$env:MSYS2_ROOT', expected '${{ steps.msys2.outputs.msys2-location }}'"
if ($env:MSYS2_ROOT -ne "$env:MSYS2_LOCATION") {
Write-Error "Error: MSYS2_ROOT is '$env:MSYS2_ROOT', expected '$env:MSYS2_LOCATION'"
exit 1
}
- shell: python
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ The absolute path of the MSYS2 installation location. Example: `D:\a\_temp\msys6
```yaml
- uses: msys2/setup-msys2@v2
id: msys2
- run: echo '${{ steps.msys2.outputs.msys2-location }}'
- env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
run: echo "$env:MSYS2_LOCATION"
```

Available since v2.24.1
Expand Down

0 comments on commit 4326ccb

Please sign in to comment.