1
0
mirror of synced 2025-12-30 03:01:36 -05:00

add workflow_dispatch to if condition (#22732)

* add workflow_dispatch to if condition

* print PR_TITLE

Co-authored-by: Octomerger Bot <63058869+Octomerger@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
This commit is contained in:
Kevin Xu
2021-11-22 10:50:18 -08:00
committed by GitHub
parent a6e021a6cd
commit d2c6d478fa

View File

@@ -19,9 +19,7 @@ on:
jobs:
sync:
name: Get the latest docs
if: >-
github.event.pull_request.merged == true &&
github.repository == 'github/docs-internal'
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.repository == 'github/docs-internal')
runs-on: ubuntu-latest
permissions:
contents: write
@@ -49,6 +47,7 @@ jobs:
git checkout -b automated-sync-$GITHUB_RUN_ID
git add .
PR_TITLE=${{ github.event.pull_request.title }}
echo PR_TITLE: $PR_TITLE
[[ ! -z $PR_TITLE ]] && DESCRIPTION="${PR_TITLE}" || DESCRIPTION="Update manually triggered by workflow"
echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_ENV
git commit -m "$(echo $DESCRIPTION)"