-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (27 loc) · 864 Bytes
/
Copy pathcheck-pr-sync.yml
File metadata and controls
32 lines (27 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Check and trigger auto-merge
on:
schedule:
- cron: '0 */20 * * *'
workflow_dispatch:
jobs:
check_and_trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all remote branches
run: git fetch --all
- name: Find pr-sync-* branch and dispatch merge
run: |
BRANCH=$(git branch -r | grep 'origin/pr-sync-' | head -n 1 | sed 's|origin/||' | xargs)
echo "Found branch: '$BRANCH'"
if [ -n "$BRANCH" ]; then
echo "Triggering auto-merge for $BRANCH"
gh workflow run auto-merge-sync.yml -f branch="$BRANCH"
else
echo "No pr-sync-* branch found. Nothing to do."
fi
env:
GH_TOKEN: ${{ secrets.LEARNSPACE_PAT }}