mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 06:02:22 -05:00
[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.
This commit is contained in:
committed by
GitHub
parent
6022929551
commit
eabf09587f
34
.github/workflows/merge-freeze-unfreeze.yml
vendored
Normal file
34
.github/workflows/merge-freeze-unfreeze.yml
vendored
Normal file
@@ -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."
|
||||
6
upcoming-release-notes/7094.md
Normal file
6
upcoming-release-notes/7094.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [MatissJanis]
|
||||
---
|
||||
|
||||
Add 'unfreeze' label that can be used to unfreeze PRs during mergefreeze
|
||||
Reference in New Issue
Block a user