Skip to content

Commit

Permalink
[core] Cleanup issues body (#10372)
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk authored Sep 17, 2023
1 parent 7010922 commit 25d175c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/issue-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Cleanup issue comment

on:
issues:
types:
- opened

permissions: {}

jobs:
issue_cleanup:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
with:
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const text =
'### Duplicates\r\n\r\n- [X] I have searched the existing issues\r\n\r\n### Latest version\r\n\r\n- [X] I have tested the latest version\r\n\r\n';
const body = issue.data.body.replace(text, '');
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body,
})

0 comments on commit 25d175c

Please sign in to comment.