From e62c68e03b0d926522408410a26eae7b7c2ff335 Mon Sep 17 00:00:00 2001 From: Robert Sese <734194+rsese@users.noreply.github.com> Date: Tue, 20 Sep 2022 12:02:28 -0500 Subject: [PATCH] Try to fix policy sync workflow (#30821) --- .github/workflows/site-policy-sync.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/site-policy-sync.yml b/.github/workflows/site-policy-sync.yml index 1e59bbe2a7..7d88c6a5f1 100644 --- a/.github/workflows/site-policy-sync.yml +++ b/.github/workflows/site-policy-sync.yml @@ -53,7 +53,7 @@ jobs: echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_ENV git commit -m "$(echo $DESCRIPTION)" - - name: If there are changes to push, create a pull request in the public repo using the gh command line tool, then immediately merge the PR and delete the branch + - name: If there are changes to push, create a pull request in the public repo using the gh command line tool, then immediately approve the PR id: createAndMergePullRequest env: GITHUB_TOKEN: ${{ secrets.API_TOKEN_SITEPOLICY }} @@ -70,11 +70,7 @@ jobs: git push --set-upstream origin automated-sync-$GITHUB_RUN_ID PR_URL=$(gh pr create --title "${TITLE}" --body-file msg --head automated-sync-$GITHUB_RUN_ID --base main --repo github/site-policy) gh pr diff ${PR_URL} - gh pr merge ${PR_URL} --merge --delete-branch + gh pr review --approve || echo "Nothing to approve" else echo "No updates to push to the public repo" fi - - - name: Delete remote updates branch if previous step failed - if: failure() && steps.createAndMergePullRequest.outcome == 'failure' - run: git push github/site-policy --delete automated-sync-$GITHUB_RUN_ID