diff --git a/.github/workflows/issues_dailyCron.yml b/.github/workflows/issues_dailyCron.yml index 536b8bf..1f5aadf 100644 --- a/.github/workflows/issues_dailyCron.yml +++ b/.github/workflows/issues_dailyCron.yml @@ -3,24 +3,29 @@ name: 'Daily Cron - 00:00' on: schedule: - cron: '0 0 * * *' + workflow_dispatch: # Allows manual triggering from the Github UI permissions: - issues: write - statuses: read + issues: write # Required to close issues and post comments jobs: cron-tasks: runs-on: ubuntu-latest steps: - name: check for inactive issues that can't be reproduced - uses: actions-cool/issues-helper@v3 + uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 with: - actions: 'close-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'status: can not reproduce' - inactive-day: 14 - close-reason: 'completed' - body: | + repo-token: ${{ secrets.GITHUB_TOKEN }} + only-labels: 'status: can not reproduce' # Only process issues with this label + days-before-stale: 0 # Mark immediately, the label comment is the warning + days-before-close: 14 # Close after 14 days without activity + stale-issue-label: 'stale: can not reproduce' + stale-issue-message: '' # No extra warning comment + close-issue-reason: 'completed' + days-before-pr-stale: -1 # Don't apply to PRs + days-before-pr-close: -1 # PRs disabled + operations-per-run: 100 + close-issue-message: | Hello! As we have not received any new or updated information to reproduce this issue in the last 14 days we are marking this issue as closed. Should you have new information please feel free to respond and we will consider reopening it. diff --git a/.github/workflows/issues_handleLabel.yml b/.github/workflows/issues_handleLabel.yml index 0b02416..1acdff8 100644 --- a/.github/workflows/issues_handleLabel.yml +++ b/.github/workflows/issues_handleLabel.yml @@ -5,13 +5,7 @@ on: types: [labeled] permissions: - issues: write - pull-requests: write - actions: read - checks: read - contents: read - repository-projects: read - statuses: read + issues: write # Required to comment on and close issues jobs: issue-labeled: @@ -20,12 +14,9 @@ jobs: # Unable to Reproduce Tasks - name: 'Comment: unable to reproduce' if: "${{ github.event.label.name == 'status: can not reproduce' }}" - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + BODY: | > This is a templated message Hello @${{ github.event.issue.user.login }}, @@ -36,16 +27,20 @@ jobs: Please note that issues labeled with `status: can not reproduce` will be closed in 14 days if there is no activity. Thank you! + with: + script: | + await github.rest.issues.createComment({ + ...context.repo, + issue_number: context.issue.number, + body: process.env.BODY, + }); # Invalid bug report template actions - - name: 'Comment: invalid bug report template' + - name: 'Comment and close: invalid bug report template' if: "${{ github.event.label.name == 'flag: invalid template' }}" - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + BODY: | > This is a templated message Hello @${{ github.event.issue.user.login }}, @@ -56,24 +51,26 @@ jobs: Please update the issue with the template and we can reopen this report. Thank you. - - name: 'Close: invalid bug report template' - if: "${{ github.event.label.name == 'flag: invalid template' }}" - uses: actions-cool/issues-helper@v3 with: - actions: 'close-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - close-reason: 'not_planned' + script: | + await github.rest.issues.createComment({ + ...context.repo, + issue_number: context.issue.number, + body: process.env.BODY, + }); + await github.rest.issues.update({ + ...context.repo, + issue_number: context.issue.number, + state: 'closed', + state_reason: 'not_planned', + }); # Redirect questions to community sources - - name: 'Comment: redirect question to community' + - name: 'Comment and close: redirect question to community' if: "${{ github.event.label.name == 'flag: question' }}" - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + BODY: | > This is a templated message Hello @${{ github.event.issue.user.login }}, @@ -86,11 +83,16 @@ jobs: Please see the following contributing guidelines for asking a question [here](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md#reporting-an-issue). Thank you. - - name: 'Close: redirect question to community' - if: "${{ github.event.label.name == 'flag: question' }}" - uses: actions-cool/issues-helper@v3 with: - actions: 'close-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - close-reason: 'complete' + script: | + await github.rest.issues.createComment({ + ...context.repo, + issue_number: context.issue.number, + body: process.env.BODY, + }); + await github.rest.issues.update({ + ...context.repo, + issue_number: context.issue.number, + state: 'closed', + state_reason: 'completed', + });