Update merge-live to ensure a PR is always available (#24357)

pull/24351/head
Kirk Larkin 2021-12-17 18:45:03 +00:00 committed by GitHub
parent 9228a87ce8
commit 36f989d350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 5 deletions

View File

@ -1,16 +1,24 @@
name: Merge to Live
on:
push:
branches:
- main
permissions:
contents: read
pull-requests: write
on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
env:
DOTNET_DOCS_HEAD: main
DOTNET_DOCS_BASE: live
jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: gh pr create --base live --head main --title "Merge to Live" --body "[AUTOMATED]"
- run: |
if [ "$(gh pr list --base $DOTNET_DOCS_BASE --head $DOTNET_DOCS_HEAD --json id --jq ". | length")" -ne "0" ]; then
echo "::notice title=Skipping Workflow::A pull request for branch \"$DOTNET_DOCS_HEAD\" into branch \"$DOTNET_DOCS_BASE\" already exists."
else
gh pr create --base $DOTNET_DOCS_BASE --head $DOTNET_DOCS_HEAD --title "Merge to Live" --body "[AUTOMATED]"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}