mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 15:36:50 -05:00
* [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.
35 lines
1.5 KiB
YAML
35 lines
1.5 KiB
YAML
# 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."
|