From 7c045a978774ae2f13c79077fddc28805c7293e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 13 May 2025 12:37:02 +0200 Subject: [PATCH] update-clan-core: use pr id --- .gitea/workflows/update-clan-core-for-checks.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/update-clan-core-for-checks.yml b/.gitea/workflows/update-clan-core-for-checks.yml index 2ec94a5af..b37a56545 100644 --- a/.gitea/workflows/update-clan-core-for-checks.yml +++ b/.gitea/workflows/update-clan-core-for-checks.yml @@ -21,7 +21,7 @@ jobs: git commit -am "Update pinned clan-core for checks" git push origin +HEAD:update-clan-core-for-checks set -x - nix run --inputs-from . nixpkgs#curl -- -X POST \ + resp=$(nix run --inputs-from . nixpkgs#curl -- -X POST \ -H "Authorization: token $CI_BOT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ @@ -30,4 +30,16 @@ jobs: "title": "Update Clan Core for Checks", "body": "This PR updates the pinned clan-core flake input that is used for checks." }' \ - "https://git.clan.lol/api/v1/repos/clan/clan-core/pulls" + "https://git.clan.lol/api/v1/repos/clan/clan-core/pulls") + pr_id=$(echo "$resp" | jq -r '.id') + + # Merge when succeed + nix run --inputs-from . nixpkgs#curl -- -X POST \ + -H "Authorization: token $CI_BOT_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "Do": "merge", + "merge_when_checks_succeed": true, + "delete_branch_after_merge": true, + }' \ + "https://git.clan.lol/api/v1/repos/clan/clan-core/pulls/$pr_id/merge"