Skip to content

Create PR from Staging to Master #14

Create PR from Staging to Master

Create PR from Staging to Master #14

Workflow file for this run

name: Create PR from Staging to Master
on:
schedule:
- cron: '0 18 * * SUN'
pull_request:
types:
- synchronize
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check for pending commits
id: check-commits
run: |
COMMIT_DIFF=$(git log --pretty=format:'' staging..master)
if [[ -z "$COMMIT_DIFF" ]]; then
echo "No pending commits. Skipping workflow."
exit 78
fi
- name: Create PR
if: steps.check-commits.outcome != 'failure'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Staging -> Master
body: |
${{ steps.get-commit-messages.outputs.commit-messages }}
branch: staging
base: master
- name: Get commit messages
id: get-commit-messages
run: |
COMMIT_MESSAGES=$(git log --pretty=format:'%s' staging..master)
echo "::set-output name=commit-messages::$COMMIT_MESSAGES"