Skip to content

chore(deps): update rust crate glib to 0.22.7 #752

chore(deps): update rust crate glib to 0.22.7

chore(deps): update rust crate glib to 0.22.7 #752

Workflow file for this run

name: Nix Derivation
on:
pull_request_target:
branches: [master]
paths:
- 'Cargo.lock'
- 'package.nix'
- '.github/workflows/nix.yml'
jobs:
fix-hashes:
name: Fix Nix Hashes
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install Nix
uses: cachix/install-nix-action@v31
- uses: dtolnay/rust-toolchain@stable
- name: Install fixsha
run: cargo install fixsha
- name: Run fixsha
run: fixsha
- name: Push hash fix if needed
if: github.event.pull_request.head.repo.full_name == github.repository
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ -z $(git status -s package.nix) ]]; then
echo "No hash changes needed"
exit 0
fi
CONTENT=$(base64 -w 0 package.nix)
SHA=$(gh api repos/${{ github.repository }}/contents/package.nix \
--jq '.sha' \
-H "Accept: application/vnd.github+json" \
--method GET \
-f ref=${{ github.event.pull_request.head.ref }})
gh api repos/${{ github.repository }}/contents/package.nix \
--method PUT \
-H "Accept: application/vnd.github+json" \
-f message="fix(nix): update cargoHash" \
-f content="$CONTENT" \
-f sha="$SHA" \
-f branch=${{ github.event.pull_request.head.ref }}
echo "Nix hashes updated via API commit"
- name: Comment on fork PRs
if: github.event.pull_request.head.repo.full_name != github.repository
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ -z $(git status -s package.nix) ]]; then
echo "No hash changes needed"
exit 0
fi
NEW_HASH=$(grep 'cargoHash' package.nix | sed 's/.*"\(.*\)".*/\1/')
gh pr comment ${{ github.event.pull_request.number }} \
-R ${{ github.repository }} \
--body "The \`cargoHash\` in \`package.nix\` needs updating. Please update it to:
\`\`\`nix
cargoHash = \"$NEW_HASH\";
\`\`\`"