-
Notifications
You must be signed in to change notification settings - Fork 8
39 lines (29 loc) · 1.59 KB
/
dev-branch-merge.yaml
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
33
34
35
36
37
38
39
name: Auto Merge Dev Branch
on:
schedule:
- cron: '0 0 * * 1'
jobs:
create_pull_request:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create pull request
run: |
title="Automatic PR: Merging dev into main ($(git rev-parse --short=7 remotes/origin/dev))"
body="
This pull request was automatically created by GitHub Actions, and it is automatically done every week. It merges all of the changes that have happened on the \`dev\` branch into the \`main\` branch.
The reason why the [\`dev\`](https://github.com/Atlas-OS/Atlas-Utilities/tree/dev) branch exists is to make sure that all of the code in [\`main\`](https://github.com/Atlas-OS/Atlas-Utilities) has been properly reviewed and approved. **Five contributors** have to approve this pull request for it to be merged.
**See here for more information:** https://docs.atlasos.net/contributions
**Last commit to [\`dev\`](https://github.com/Atlas-OS/Atlas-Utilities/tree/dev):** https://github.com/Atlas-OS/Atlas-Utilities/commit/$(git rev-parse remotes/origin/dev)
"
gitLog=$(git log main..remotes/origin/dev)
if [ -n "$gitLog" ]; then
gh pr create -B "main" -H "dev" --title "$title" -l "auto-pr" --body "$body"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}