Get the labels for a pull request. Doesn't do much, but the return value lets you write you own scripts based off of the PR labels!


--prNumberThe pull request the command should use. Detects PR number in CI (defaults to last merged PR)
--existsStringChecks for existence of a specific label


auto label --pr 123

Using in scripts

The following will only run the test:visual script when the PR has has the
Visual label.

export PATH=$(npm bin):$PATH

if auto label --pr $PR_NUMBER --exists Visual;
  npm run test:visual

Without PR Number

Running auto label without the PR number will:

  • When run in master will get the labels for the last merged PR
  • When run for a PR in CI will use the PR's number