From b58b34d56dd7c9b8c8a942a40228131efa399dc6 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Sat, 1 Jul 2023 09:06:02 -0700 Subject: [PATCH] Document label and milestone actions --- README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 481e05b..317ac51 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,77 @@ _This project is currently in its alpha stage and might be incomplete or change ## Installation ```sh -git clone https://github.com/scientific-python/changelist.git pip install changelist ``` +## Set up your repository + +All PRs must have one of the following labels: + +- `type: Highlights` +- `type: New features` +- `type: Enhancements` +- `type: Performance` +- `type: Bug fix"` +- `type: API` +- `type: Maintenance` +- `type: Documentation` +- `type: Infrastructure` + +### Label checking + +To ensure that each PR has one of the above labels attached to it, +we recommend adding the following to `.github/workflows/label-check.yaml`: + +``` +name: Labels + +on: + pull_request: + types: + - opened + - labeled + - unlabeled + +env: + LABELS: ${{ join( github.event.pull_request.labels.*.name, ' ' ) }} + +jobs: + check-type-label: + name: ensure type label + runs-on: ubuntu-latest + steps: + - if: "contains( env.LABELS, 'type: ' ) == false" + run: exit 1 +``` + +### Milestones + +We also recommend adding `.github/workflows/milestone-merged-prs.yaml`: + +``` +name: Milestone + +on: + pull_request_target: + types: + - closed + branches: + - "main" + +jobs: + milestone_pr: + name: attach to PR + runs-on: ubuntu-latest + steps: + - uses: scientific-python/attach-next-milestone-action@f94a5235518d4d34911c41e19d780b8e79d42238 + with: + token: ${{ secrets.MILESTONE_LABELER_TOKEN }} + force: true +``` + +See https://github.com/scientific-python/attach-next-milestone-action for more information. + ## Usage ```sh