From 47a7fefc1b586f72eaefdc81b6e05aa030e118f5 Mon Sep 17 00:00:00 2001 From: Nick Robinson Date: Mon, 25 Sep 2023 14:36:21 +0100 Subject: [PATCH] Add GitHub template and workflows needed on the default branch (#70) * Copy across GitHub Action workflows * Add workflow to close stale PRs * Add PR template * Remove codeowners from upstream --- .github/CODEOWNERS | 6 ------ .github/pull_request_template.md | 13 +++++++++++++ .github/workflows/LabelCheck.yml | 19 +++++++++++++++++++ .github/workflows/labeler.yml | 17 +++++++++++++++++ .github/workflows/stale.yml | 16 ++++++++++++++++ 5 files changed, 65 insertions(+), 6 deletions(-) delete mode 100644 .github/CODEOWNERS create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/LabelCheck.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index bf1380f5a07bc..0000000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,6 +0,0 @@ -CODEOWNERS @JuliaLang/github-actions -/.github/ @JuliaLang/github-actions -/.buildkite/ @JuliaLang/github-actions - -/.github/workflows/rerun_failed.yml @DilumAluthge -/.github/workflows/statuses.yml @DilumAluthge diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000000..b197aeb9adfab --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ + +## PR Description + +_What does this PR do?_ + +## Checklist + +Requirements for merging: +- [ ] I have opened an issue or PR upstream on JuliaLang/julia: +- [ ] I have removed the `port-to-*` labels that don't apply. diff --git a/.github/workflows/LabelCheck.yml b/.github/workflows/LabelCheck.yml new file mode 100644 index 0000000000000..194b0c92065c9 --- /dev/null +++ b/.github/workflows/LabelCheck.yml @@ -0,0 +1,19 @@ +name: Labels + +permissions: + contents: read +on: + pull_request: + types: [labeled, unlabeled, opened, reopened, edited, synchronize] +jobs: + enforce-labels: + name: Check for blocking labels + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - uses: yogevbd/enforce-label-action@2.2.2 + with: + # REQUIRED_LABELS_ANY: "bug,enhancement,skip-changelog" + # REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','enhancement','skip-changelog']" + BANNED_LABELS: "needs docs,needs compat annotation,needs more info,needs nanosoldier run,needs news,needs pkgeval,needs tests,DO NOT MERGE" + BANNED_LABELS_DESCRIPTION: "A PR should not be merged with `needs *` or `DO NOT MERGE` labels" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000000..2141a906e96cd --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,17 @@ +# See https://github.com/actions/labeler +name: "Pull Request Labeler" +on: + pull_request_target: + types: + - opened + +jobs: + triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v4 + with: + dot: true diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000000..3df2093491753 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,16 @@ +name: "Close stale PRs" +on: + schedule: + - cron: "0 0 * * *" # every night at midnight + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v8 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Comment or remove stale label, or this PR will be closed in 5 days.' + days-before-stale: 30 + days-before-close: 5 + stale-pr-label: 'stale'