Skip to content

Commit e1a5af4

Browse files
committed
Create sync-dev-to-vX.Y-dev-experiment.yaml
Dummy workflow to test auto-approval of PRs
1 parent 0004349 commit e1a5af4

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: sync-dev-to-vX.Y-dev
2+
3+
# author: @ralfhandl
4+
5+
#
6+
# This workflow creates PRs to update the vX.Y-dev branch with the latest changes from dev
7+
#
8+
9+
# run this on push to dev
10+
on:
11+
push:
12+
branches:
13+
- main-approve-sync-prs
14+
15+
jobs:
16+
sync-branches:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Generate access token
20+
id: generate-token
21+
uses: actions/create-github-app-token@v2
22+
with:
23+
app-id: ${{ secrets.OAI_SPEC_PUBLISHER_APPID }}
24+
private-key: ${{ secrets.OAI_SPEC_PUBLISHER_PRIVATE_KEY }}
25+
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Create pull requests
32+
id: pull_requests
33+
shell: bash
34+
run: |
35+
DEV_BRANCHES=$(git branch -r --list origin/v?.?-dev)
36+
for DEV_BRANCH in $DEV_BRANCHES; do
37+
BASE=${DEV_BRANCH:7}
38+
EXISTS=$(gh pr list --base $BASE --head $HEAD \
39+
--json number --jq '.[] | .number')
40+
if [ ! -z "$EXISTS" ]; then
41+
echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
42+
gh pr review --approve $EXISTS
43+
continue
44+
fi
45+
46+
# gh pr create --base $BASE --head $HEAD \
47+
# --label "Housekeeping" \
48+
# --title "$BASE: update from $HEAD" \
49+
# --body "Merge \`$HEAD\` into \`$BASE\`."
50+
done
51+
env:
52+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
53+
HEAD: dev

0 commit comments

Comments
 (0)