From 44ed011897952da46110ed867ec8b3a32588fb4d Mon Sep 17 00:00:00 2001 From: Jeroen Simonetti Date: Tue, 31 Oct 2023 14:43:22 +0100 Subject: [PATCH] [nix] try to auto update vendorsha Signed-off-by: Jeroen Simonetti --- .github/workflows/nix-build.yaml | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/nix-build.yaml b/.github/workflows/nix-build.yaml index 7bc6359..40c5f67 100644 --- a/.github/workflows/nix-build.yaml +++ b/.github/workflows/nix-build.yaml @@ -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 }}