Skip to content

Commit 0c02f91

Browse files
authored
Enable auto-merge for translation-batches (#23464)
* Enable auto-merge for translation-batches * Attempt to approve and set auto-merge * Temporarily disable check for tests * Test commit. Revert later. * Not self approving anymore * Improve failure message * Fix auto-merge * Remove test code * Add ownership to @github-actions
1 parent b4a49fe commit 0c02f91

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package.json @github/docs-engineering
2020
/.github/workflows/crowdin.yml @github/docs-localization
2121
/crowdin*.yml @github/docs-engineering @github/docs-localization
2222
/translations/ @github/docs-engineering @github/docs-localization @github-actions
23-
/translations/log/ @github/docs-localization
23+
/translations/log/ @github/docs-localization @github-actions
2424

2525
# Site Policy
2626
/content/github/site-policy/ @github/site-policy-admins

.github/workflows/create-translation-batch-pr.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ jobs:
172172
--body-file /tmp/pr-body.txt || git push origin :${{ steps.set-branch.outputs.BRANCH_NAME }} \
173173
--label "translation-batch"
174174
175+
- name: Approve PR
176+
if: github.ref_name == 'main'
177+
env:
178+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
179+
run: gh pr review --approve || echo "Nothing to approve"
180+
181+
- name: Set auto-merge
182+
if: github.ref_name == 'main'
183+
env:
184+
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
185+
run: gh pr merge ${{ steps.set-branch.outputs.BRANCH_NAME }} --auto --squash || echo "Nothing to merge"
186+
175187
# When the maximum execution time is reached for this job, Actions cancels the workflow run.
176188
# This emits a notification for the first responder to triage.
177189
- name: Send Slack notification if workflow is cancelled

0 commit comments

Comments
 (0)