From eabf09587f04ec5142f16e1c33086a6e89f91f60 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Sat, 28 Feb 2026 21:15:11 +0000 Subject: [PATCH] [AI] Github action for unfreezing PRs (#7094) * [AI] Add GitHub Action to add PR to Merge Freeze unblocked list when unfreeze label is added Made-with: Cursor * Rename 7093.md to 7094.md * Add concurrency control to unfreeze job in merge-freeze-unfreeze workflow - Introduced concurrency settings to prevent overlapping executions of the unfreeze job based on labels. - Updated error handling to abort the process if fetching the current merge freeze status fails, ensuring unblocked PRs are not overwritten. * Refactor Merge Freeze workflow to simplify PR unblocking process - Updated the workflow to directly post the PR to the unblocked list without fetching the current freeze status. - Improved error handling by ensuring the access token is set before proceeding with the API call. --- .github/workflows/merge-freeze-unfreeze.yml | 34 +++++++++++++++++++++ upcoming-release-notes/7094.md | 6 ++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/merge-freeze-unfreeze.yml create mode 100644 upcoming-release-notes/7094.md diff --git a/.github/workflows/merge-freeze-unfreeze.yml b/.github/workflows/merge-freeze-unfreeze.yml new file mode 100644 index 0000000000..4ca4fbc668 --- /dev/null +++ b/.github/workflows/merge-freeze-unfreeze.yml @@ -0,0 +1,34 @@ +# When the "unfreeze" label is added to a PR, add that PR to Merge Freeze's unblocked list +# so it can be merged during a freeze. Requires MERGEFREEZE_ACCESS_TOKEN repo secret +# (project-specific token from Merge Freeze Web API panel for actualbudget/actual / master). +# See: https://docs.mergefreeze.com/web-api#post-freeze-status + +name: Merge Freeze – add PR to unblocked list + +on: + pull_request: + types: [labeled] + +jobs: + unfreeze: + if: ${{ github.event.label.name == 'unfreeze' }} + runs-on: ubuntu-latest + concurrency: + group: merge-freeze-unfreeze-${{ github.ref }}-labels + cancel-in-progress: false + steps: + - name: POST to Merge Freeze – add PR to unblocked list + env: + MERGEFREEZE_ACCESS_TOKEN: ${{ secrets.MERGEFREEZE_ACCESS_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + USER_NAME: ${{ github.actor }} + run: | + set -e + if [ -z "$MERGEFREEZE_ACCESS_TOKEN" ]; then + echo "::error::MERGEFREEZE_ACCESS_TOKEN secret is not set" + exit 1 + fi + url="https://www.mergefreeze.com/api/branches/actualbudget/actual/master/?access_token=${MERGEFREEZE_ACCESS_TOKEN}" + payload=$(jq -n --arg user_name "$USER_NAME" --argjson pr "$PR_NUMBER" '{frozen: true, user_name: $user_name, unblocked_prs: [$pr]}') + curl -sf -X POST "$url" -H "Content-Type: application/json" -d "$payload" + echo "Merge Freeze updated: PR #$PR_NUMBER added to unblocked list." diff --git a/upcoming-release-notes/7094.md b/upcoming-release-notes/7094.md new file mode 100644 index 0000000000..e370ef4a55 --- /dev/null +++ b/upcoming-release-notes/7094.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Add 'unfreeze' label that can be used to unfreeze PRs during mergefreeze