From d2c6d478faed4be2db28df38bac343789fa8889e Mon Sep 17 00:00:00 2001 From: Kevin Xu Date: Mon, 22 Nov 2021 10:50:18 -0800 Subject: [PATCH] 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 --- .github/workflows/site-policy-sync.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/site-policy-sync.yml b/.github/workflows/site-policy-sync.yml index 4ee14f2c61..84e4442605 100644 --- a/.github/workflows/site-policy-sync.yml +++ b/.github/workflows/site-policy-sync.yml @@ -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)"