-
Notifications
You must be signed in to change notification settings - Fork 56
40 lines (30 loc) · 1.61 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
40
name: Auto Merge Dev Branch
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
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 master ($(git rev-parse --short=7 remotes/origin/dev))"
body="
This pull request was automatically created by GitHub Actions, and it is automatically done at the start of every Monday or manually ran. It merges all of the changes that have happened on the \`dev\` branch into the \`master\` branch.
The reason why the [\`dev\`](https://github.com/Atlas-OS/docs/tree/dev) branch exists is to make sure that all of the code in [\`master\`](https://github.com/Atlas-OS/docs) 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/docs/tree/dev):** https://github.com/Atlas-OS/docs/commit/$(git rev-parse remotes/origin/dev)
"
gitLog=$(git log master..remotes/origin/dev)
if [ -n "$gitLog" ]; then
gh pr create -B "master" -H "dev" --title "$title" -l "auto-pr" --body "$body"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}