Skip to content

Commit a549085

Browse files
mchammer01Copilot
andauthored
Update workflow so that PRs are automerged when they pass all the CI tests (#61234)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4840cbd commit a549085

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/sync-secret-scanning.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,27 @@ jobs:
7272
--title "Sync secret scanning data" \
7373
--body '👋 humans. This PR updates the secret scanning data with the latest changes from github/token-scanning-service.
7474
75-
/cc @github/docs-content-security-products
75+
If CI passes, this PR will be auto-merged. :green_heart:
7676
7777
If CI does not pass or other problems arise, contact #docs-engineering on Slack.' \
7878
--repo github/docs-internal \
79-
--label secret-scanning-pipeline,'skip FR board',ready-for-doc-review,workflow-generated \
79+
--label secret-scanning-pipeline,'skip FR board',workflow-generated \
8080
--head=$branchname
8181
82+
# can't approve your own PR, approve with Actions
83+
echo "Approving pull request..."
84+
unset GITHUB_TOKEN
85+
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
86+
gh pr review --approve
87+
echo "Approved pull request"
88+
89+
# Actions can't merge the PR so back to docs-bot to merge
90+
echo "Setting pull request to auto merge..."
91+
unset GITHUB_TOKEN
92+
gh auth login --with-token <<< "${{ secrets.DOCS_BOT_PAT_BASE }}"
93+
gh pr merge --auto --merge
94+
echo "Set pull request to auto merge"
95+
8296
- uses: ./.github/actions/slack-alert
8397
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
8498
with:

0 commit comments

Comments
 (0)