Skip to content

Auto Merge Dev Branch #25

Auto Merge Dev Branch

Auto Merge Dev Branch #25

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 main ($(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 were made to the \`dev\` branch into the \`main\` branch.
The reason why the [\`dev\`](https://github.com/Atlas-OS/Atlas/tree/dev) branch exists is to make sure that all of the code in [\`main\`](https://github.com/Atlas-OS/Atlas) 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/tree/dev):** https://github.com/Atlas-OS/Atlas/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 }}