-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'issue-translator' | ||
on: | ||
issue_comment: | ||
types: [created] | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: usthe/[email protected] | ||
with: | ||
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
IS_MODIFY_TITLE: true | ||
# not require, default false, . Decide whether to modify the issue title | ||
# if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot. | ||
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. π―ππ»π§βπ€βπ§π«π§πΏβπ€βπ§π»π©πΎβπ€βπ¨πΏπ¬πΏ | ||
# not require. Customize the translation robot prefix message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Reopen and Update Stale Issues | ||
|
||
on: | ||
workflow_dispatch: # ζε¨θ§¦ε | ||
|
||
jobs: | ||
reopen_stale_issues: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch Closed Issues with lifecycle/stale Label | ||
id: fetch_issues | ||
uses: actions/[email protected] | ||
with: | ||
github-token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
script: | | ||
const issues = await github.paginate(github.rest.issues.listForRepo, { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: 'closed', | ||
labels: 'lifecycle/stale', | ||
per_page: 100 | ||
}); | ||
return JSON.stringify(issues.map(issue => issue.number)); | ||
result-encoding: string | ||
|
||
- name: Reopen and Remove Label | ||
uses: actions/[email protected] | ||
with: | ||
github-token: ${{ secrets.BOT_GITHUB_TOKEN }} | ||
script: | | ||
const issueNumbers = JSON.parse(`{{ steps.fetch_issues.outputs.result }}`); | ||
for (const issue_number of issueNumbers) { | ||
// Reopen the issue | ||
await github.rest.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number, | ||
state: 'open' | ||
}); | ||
console.log(`Reopened issue #${issue_number}`); | ||
// Remove the lifecycle/stale label | ||
await github.rest.issues.removeLabel({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number, | ||
name: 'lifecycle/stale' | ||
}); | ||
console.log(`Removed label 'lifecycle/stale' from issue #${issue_number}`); | ||
} |