Skip to content

Commit e78758c

Browse files
authored
Merge pull request #80 from KelvinTegelaar/master
[pull] master from KelvinTegelaar:master
2 parents fe149f9 + 2eaab47 commit e78758c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/Automated_merge.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Automated Merges
2+
3+
on:
4+
schedule:
5+
# Runs every day at 00:00 UTC
6+
- cron: "0 0 * * *"
7+
workflow_dispatch:
8+
9+
jobs:
10+
# Job 1: Merge dev -> release/nightly (run daily except Friday)
11+
dev-to-nightly:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check weekday
15+
id: check-day
16+
run: |
17+
# Monday=1 ... Friday=5 ... Sunday=7
18+
DAY_OF_WEEK=$(date +'%u')
19+
echo "day_of_week=$DAY_OF_WEEK" >> $GITHUB_OUTPUT
20+
21+
- name: Create and merge PR from dev to release/nightly
22+
if: ${{ steps.check-day.outputs.day_of_week != '5' }}
23+
uses: peter-evans/create-pull-request@v7
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
source-branch: dev
27+
target-branch: release/nightly
28+
branch: auto/dev-to-nightly
29+
title: "Nightly Merge: dev → release/nightly"
30+
body: "This PR was automatically created and merged by GitHub Actions."
31+
auto-merge: true
32+
merge-method: squash
33+
34+
# Job 2: Merge release/nightly -> release/beta (run only on Friday)
35+
nightly-to-beta:
36+
runs-on: ubuntu-latest
37+
needs: [dev-to-nightly]
38+
steps:
39+
- name: Check weekday
40+
id: check-day
41+
run: |
42+
DAY_OF_WEEK=$(date +'%u')
43+
echo "day_of_week=$DAY_OF_WEEK" >> $GITHUB_OUTPUT
44+
45+
- name: Create and merge PR from release/nightly to release/beta
46+
if: ${{ steps.check-day.outputs.day_of_week == '5' }}
47+
uses: peter-evans/create-pull-request@v7
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
source-branch: release/nightly
51+
target-branch: release/beta
52+
branch: auto/nightly-to-beta
53+
title: "Weekly Merge: release/nightly → release/beta"
54+
body: "This PR was automatically created and merged by GitHub Actions."
55+
auto-merge: true
56+
merge-method: squash

0 commit comments

Comments
 (0)