This action ensures that a pull request label is applied to only one pull request at a time. When you apply a unique label to a PR, this action will automatically remove it from any other PR currently labeled with it.
This can be helpful when using labels to trigger deployments or builds without having to manually unlabel previous PRs.
Create a .github/workflows/unique-labels.yml
on:
pull_request:
types: [opened, edited]
name: unique-pr-labels
jobs:
label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: stephdotnet/unique-labels@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: "["label-one", "label-two"]"
The following options allow you to test the action live (using local-action or act) or using jest. In any cases you'll have to run all the tests before submitting the PR (jest + lint)
- Run
npm install
- Make the changes
- Run
npm run all
- Open a pull request
- Create the
.env
file from.env.example
- Set a value for
INPUT_TOKEN
(Github PAT)
- Set a value for
- Run
npm install
- Make the changes
- Run
local-action run ./ src/index.ts .env
(if you're using https://github.com/github/local-action)
- Install nektos/act
- Create the
.actrc
file from.actrc.example
- Set a value for
token
(Github PAT)
- Set a value for
- Run
act
- Run
npm install
- Make the changes
- Run
npm run test
| All api calls are mocked and test contexts/fixtures available in the
__tests__/fixtures
folder