Skip to content

Commit

Permalink
fixup! updpkgsums: include all required files in the sparse checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
dscho committed Jun 7, 2024
1 parent 70a37a8 commit e0c712e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/actions/init-g4w-sdk-for-pacman/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: 'Initialize Git for Windows SDK subset to run `pacman`'
description: 'This composite GitHub Action initializes a subset of the Git for Windows SDK intended to run `pacman` and friends'
inputs:
include-pacman-conf:
description: 'Whether to include the Pacman configuration files'
required: false
default: 'false'
outputs:
result:
description: 'The path to the subset of the SDK'
Expand All @@ -15,7 +20,7 @@ runs:
https://github.com/git-for-windows/git-sdk-64 .tmp &&
rev="$(git -C .tmp rev-parse HEAD)" &&
echo "rev=$rev" >>$GITHUB_OUTPUT &&
echo "cache-key=g4w-sdk-$rev-2" >>$GITHUB_OUTPUT
echo "cache-key=g4w-sdk-$rev${{ inputs.include-pacman-conf != 'false' && '+conf' || '' }}" >>$GITHUB_OUTPUT
- name: restore cached git-sdk-64 subset
id: restore-g4w-sdk
uses: actions/cache/restore@v4
Expand All @@ -40,8 +45,6 @@ runs:
git show HEAD:.sparse/minimal-sdk >"$sparse" &&
cat >>"$sparse" <<-EOF &&
/etc/makepkg.conf
/etc/pacman.conf
/etc/pacman.d/
/usr/bin/base64.exe
/usr/bin/gettext.exe
/usr/bin/makepkg
Expand All @@ -52,6 +55,14 @@ runs:
/usr/share/makepkg/
/mingw64/bin/curl.exe
EOF
if test false != '${{ inputs.include-pacman-conf }}'
then
cat >>"$sparse" <<-EOF
/etc/pacman.conf
/etc/pacman.d/
/var/lib/pacman/
EOF
fi &&
git checkout -- &&
# makepkg/updpkgsums expects `curl` to be present in `/usr/bin/`
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/updpkgsums.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
core.setOutput('token', accessToken)
- name: Initialize Git for Windows SDK subset
uses: ./.github/actions/init-g4w-sdk-for-pacman
with:
include-pacman-conf: true
- name: Clone ${{ env.REPO }}
id: clone
shell: bash
Expand Down

0 comments on commit e0c712e

Please sign in to comment.