Skip to content

Commit

Permalink
[nix] try to auto update vendorsha
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen Simonetti <[email protected]>
  • Loading branch information
jsimonetti committed Oct 31, 2023
1 parent bbb0a31 commit 44ed011
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/nix-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,27 @@ jobs:
exit $BUILD_STATUS
- name: Nix gosum diverging
uses: actions/github-script@v6
# - name: Nix gosum diverging
# uses: actions/github-script@v6
# if: failure() && steps.build.outcome == 'failure'
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: 'Nix build failed with wrong gosum, please update "vendorSha256" (${{ steps.build.outputs.OLD_HASH }}) for the package in flake.nix with the new SHA: ${{ steps.build.outputs.NEW_HASH }}'
# })


- name: Update PR
if: failure() && steps.build.outcome == 'failure'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Nix build failed with wrong gosum, please update "vendorSha256" (${{ steps.build.outputs.OLD_HASH }}) for the package in flake.nix with the new SHA: ${{ steps.build.outputs.NEW_HASH }}'
})
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
sed -i s^${{ steps.build.outputs.OLD_HASH }}^${{ steps.build.outputs.NEW_HASH }}^g default.nix
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -m "Update vendorSha256"
git push origin HEAD:${{ github.head_ref }}

0 comments on commit 44ed011

Please sign in to comment.