Skip to content

Commit 3b0594e

Browse files
Automate closing of stale translation batches (#23581)
* Automatically close stale translation batches * fix: adjust spacing for the query key Resolves CI failure: https://github.com/github/docs-internal/runs/4486848450?check_suite_focus=true#step:3:4 * Fix query * enhancement: add type filter to query `type` filter restricts results to either issues or pull requests. In this case, we want to close existing stale batches that are _only_ pull requests. Docs: https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests * feat: use lee-dohm/close-matching-issues v2.1.0 lee-dohm/close-matching-issues#357 is merged into this release, which gives the action the ability to close matching issues _and_ pull requests. Co-authored-by: Francis <15894826+francisfuzz@users.noreply.github.com>
1 parent abee056 commit 3b0594e

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/allowed-actions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default [
1414
'alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488', // v0.8.1
1515
'andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90', // v1.0.4
1616
'cschleiden/actions-linter@caffd707beda4fc6083926a3dff48444bc7c24aa', // uses github-actions-parser v0.23.0
17+
'lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f', // v2.1.0
1718
'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911', // v3.0.2
1819
'dawidd6/action-download-artifact@af92a8455a59214b7b932932f2662fdefbd78126', // v2.15.0
1920
'dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58',

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ jobs:
166166
script/i18n/report-reset-files.js --report-type=csv --language=${{ matrix.language }} --log-file=/tmp/batch.log > $csvFile
167167
git add -f $csvFile && git commit -m "Check in ${{ matrix.language }} CSV report" || echo "Nothing to commit"
168168
169+
- name: Close existing stale batches
170+
uses: lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f
171+
with:
172+
token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
173+
query: 'type:pr label:translation-batch-${{ matrix.language }}'
174+
169175
- name: Create Pull Request
170176
env:
171177
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}

0 commit comments

Comments
 (0)