From 3ba56113ba0437b2dffff20e4ab2d2fde008317f Mon Sep 17 00:00:00 2001 From: zack Date: Sun, 20 Oct 2024 14:44:16 -0400 Subject: [PATCH] disable jobset with merge --- .github/workflows/update.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 488e403..aad68e5 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -188,6 +188,25 @@ jobs: exit 1 fi + - name: Disable Hydra jobset + if: steps.update-flake.outputs.CHANGED == 'true' && steps.wait-for-build.outputs.BUILD_SUCCESS == 'true' + env: + SESSION_COOKIE: ${{ steps.hydra-session.outputs.SESSION_COOKIE }} + run: | + curl -X PUT -H "Content-Type: application/json" \ + -H "Cookie: hydra_session=$SESSION_COOKIE" \ + -d '{ + "enabled": 0, + "visible": false, + "keepnr": 3, + "schedulingshares": 100, + "checkinterval": 60, + "description": "PR #${{ github.event.pull_request.number }} - Auto-update flake dependencies (Disabled)", + "flake": "github:${{ github.repository }}/${{ env.BRANCH_NAME }}", + "type": 1 + }' \ + "${{ env.HYDRA_INSTANCE }}/jobset/${{ env.HYDRA_PROJECT }}/${{ env.HYDRA_JOBSET }}" + - name: Merge PR if build succeeds if: steps.update-flake.outputs.CHANGED == 'true' && steps.wait-for-build.outputs.BUILD_SUCCESS == 'true' env: @@ -352,6 +371,25 @@ jobs: run: | gh pr merge ${{ needs.check-existing-pr.outputs.pr_number }} --merge + - name: Disable Hydra jobset + if: steps.update-flake.outputs.CHANGED == 'true' && steps.wait-for-build.outputs.BUILD_SUCCESS == 'true' + env: + SESSION_COOKIE: ${{ steps.hydra-session.outputs.SESSION_COOKIE }} + run: | + curl -X PUT -H "Content-Type: application/json" \ + -H "Cookie: hydra_session=$SESSION_COOKIE" \ + -d '{ + "enabled": 0, + "visible": false, + "keepnr": 3, + "schedulingshares": 100, + "checkinterval": 60, + "description": "PR #${{ github.event.pull_request.number }} - Auto-update flake dependencies (Disabled)", + "flake": "github:${{ github.repository }}/${{ env.BRANCH_NAME }}", + "type": 1 + }' \ + "${{ env.HYDRA_INSTANCE }}/jobset/${{ env.HYDRA_PROJECT }}/${{ env.HYDRA_JOBSET }}" + - name: Exit if build fails if: steps.update-flake.outputs.CHANGED == 'true' && steps.wait-for-build.outputs.BUILD_SUCCESS != 'true' run: exit 1