|
1 | | -name: nf-core branch protection |
2 | | -# This workflow is triggered on PRs to `main`/`master` branch on the repository |
3 | | -# It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev` |
| 1 | +name: "Close user-tagged issues and PRs" |
4 | 2 | on: |
5 | | - pull_request_target: |
6 | | - branches: |
7 | | - - main |
8 | | - - master |
| 3 | + schedule: |
| 4 | + - cron: "0 0 * * 0" # Once a week |
9 | 5 |
|
10 | 6 | jobs: |
11 | | - test: |
| 7 | + clean-up: |
12 | 8 | runs-on: ubuntu-latest |
| 9 | + permissions: |
| 10 | + issues: write |
| 11 | + pull-requests: write |
13 | 12 | steps: |
14 | | - # PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches |
15 | | - - name: Check PRs |
16 | | - if: github.repository == 'sanger-tol/curationpretext' |
17 | | - run: | |
18 | | - { [[ ${{github.event.pull_request.head.repo.full_name }} == sanger-tol/curationpretext ]] && [[ $GITHUB_HEAD_REF == "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]] |
19 | | -
|
20 | | - # If the above check failed, post a comment on the PR explaining the failure |
21 | | - # NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets |
22 | | - - name: Post PR comment |
23 | | - if: failure() |
24 | | - uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 |
| 13 | + - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10 |
25 | 14 | with: |
26 | | - message: | |
27 | | - ## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x: |
28 | | -
|
29 | | - * Do not close this PR |
30 | | - * Click _Edit_ and change the `base` to `dev` |
31 | | - * This CI test will remain failed until you push a new commit |
32 | | -
|
33 | | - --- |
34 | | -
|
35 | | - Hi @${{ github.event.pull_request.user.login }}, |
36 | | -
|
37 | | - It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch. |
38 | | - The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release. |
39 | | - Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. |
40 | | -
|
41 | | - You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. |
42 | | - Note that even after this, the test will continue to show as failing until you push a new commit. |
43 | | -
|
44 | | - Thanks again for your contribution! |
45 | | - repo-token: ${{ secrets.GITHUB_TOKEN }} |
46 | | - allow-repeats: false |
| 15 | + stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days." |
| 16 | + stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful." |
| 17 | + close-issue-message: "This issue was closed because it has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor and then staled for 20 days with no activity." |
| 18 | + days-before-stale: 30 |
| 19 | + days-before-close: 20 |
| 20 | + days-before-pr-close: -1 |
| 21 | + any-of-labels: "awaiting-changes,awaiting-feedback" |
| 22 | + exempt-issue-labels: "WIP" |
| 23 | + exempt-pr-labels: "WIP" |
| 24 | + repo-token: "${{ secrets.GITHUB_TOKEN }}" |
0 commit comments