Skip to content

Weekly PR

Weekly PR #24

name: Weekly PR
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Change to repository directory
run: cd $GITHUB_WORKSPACE
- name: Fetch latest changes
run: git fetch
- name: Check if dev branch exists
run: |
if [[ ! $(git show-ref --quiet refs/heads/dev) ]]; then
echo "dev branch does not exist"
echo "Creating dev branch"
git checkout -b dev
git push -u origin dev
else
echo "dev branch already exists"
git checkout dev
git pull origin dev
fi
- name: Add dummy commit to dev branch to show changes
run: echo "Dummy commit" >> dummy-file.txt && git add dummy-file.txt && git commit -m "Dummy commit" && git push origin dev
- name: Render template
id: render-template
uses: chuhlomin/[email protected]
with:
template: .github/WEEKLY_PULL_REQUEST_TEMPLATE.md
- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
branch: 'dev'
base: 'main'
title: "Weekly PR - $(date +'%d %B %Y')"
body: ${{ steps.render-template.outputs.result }}
delete-branch: true