Commit Graph

40 Commits

Author SHA1 Message Date
Patrick Ellis
c9d0dfc82e 🧹 Add tests that run the whole action (#149) 2021-06-04 14:46:22 -04:00
Patrick Ellis
b884ad6838 Merge pull request #125 from HollowMan6/patch-1
Fix typo in README.md
2021-06-04 14:45:15 -04:00
Patrick Ellis
9019323db1 🧹 Add basic unit tests (#148)
This is not intended to be a comprehensive test suite; I'm just trying to get us started by adding tests for some of the most important functionality.

This necessitated some minor refactoring. Previously, `main.ts` just directly invoked the main entrypoint function `run()`, which made it impossible to unit test the module without causing the side-effects of `run`. 

As a workaround I created  a new module `labeler.ts`, which just exports the functions we want to test without executing the main entrypoint, and simplified `main.ts` so that it only imports the entrypoint and executes it.

It's basically just a re-org. The diff makes it look way more complicated than it is.
2021-06-03 16:15:47 -04:00
Patrick Ellis
ffa3fbeb8f 🧹 Update documentation (#147)
- Document the release process in `CONTRIBUTING.md`
- Add development instructions to `CONTRIBUTING.md` (adapted from [download-artifact](https://github.com/actions/download-artifact))
- Add a test badge to the `README`
- Link to `CONTRIBUTING.md` in `README`
- Unify copy between `README.md` and `action.yml`
- Copy-pasta the CoC from [download-artifact](https://github.com/actions/download-artifact)
2021-06-03 12:43:19 -04:00
Patrick Ellis
bc80d164ed Two minor fixes to the README (#80) (#146)
* Use consistent indentation style in YAML examples
* Fix typo 'indvidual'
2021-06-03 12:39:48 -04:00
Patrick Ellis
4d65903a95 🧹 Add "Build & Test" Workflow (#145) 2021-06-02 12:16:40 -04:00
Hollow Man
b7d89ab657 Fix typo
indvidual -> individual
2021-02-05 15:02:00 +08:00
Ross Brodbeck
69990a6043 Create CODEOWNERS 2021-02-04 12:26:33 -05:00
Thomas Boop
9794b1493b Add Licensed To Help Verify Prod Licenses (#91)
* Add Licensed Workflows and config files

* Manually verify licenses

* Ignore Generated Files in Git PR's
v3.0.0
2020-09-16 10:01:44 -04:00
Eric Cornelissen
e26bf79ffc Draft contributors.md update (#97)
* Draft contributors.md update

This is a proposed updated to the contributors.md document inspired by
the contributing guidelines of the actions/cache project [1]. There are
some differences, most notable the inclusion of "Development Details"
which explains and motivates the development tools (to an extend).

--
1. eed9cfe64d/CONTRIBUTING.md

* Split Contributing Guidelines and Development Handbook

Split the "Contributing Guidelines" currently found in
docs/contributors.md into a CONTRIBUTING.md file, containing the
Contributing Guidelines, and a docs/development.md file, containing
details on how the development/testing of this project works.
2020-09-15 09:57:36 -04:00
David Kale
bab130482f Update README.md 2020-09-08 14:49:21 -04:00
ylemkimon
c45f41c777 Update README to use pull_request_target event (#90) 2020-09-08 14:33:55 -04:00
David Kale
9042c970f2 Update zeit->vercel 2020-09-08 14:00:23 -04:00
David Kale
fa244eaba5 Paginate and remove old labels (#96)
* Paginate to get all changed files. Add option to remove labels

* build

* format and build
v3-preview
2020-09-08 13:09:16 -04:00
Thomas Boop
ebdf5d5f9f Add Third Party License Information to Dist files (#89)
* Add Third Party License Information

* Update licenses for @actions npm modules
2020-08-07 14:32:22 -04:00
Jameel Al-Aziz
efc1b29f09 Fix "any" matching when not all globs match (#75)
The previous logic had a bug where the "any" pattern list could match
against changed files even when not all globs matched a single changed
file. The bug arose individual globs in the "any" list were tested
against all changed files individually. Therefore, as long as at least
one changed file matched an individual glob in the list, a successful
match would be found.

The correct behavior is to match all the globs in the list against each
individual file. This ensures that is possible to define exlcusions
correctly and matched the documented behavior.
2020-06-19 10:55:47 -04:00
Jameel Al-Aziz
4b52aec09b Add support for exclusions (#22)
* Add support for exclusions

Paths can be negated to stop searching through the remaining patterns in
a the glob list. All changed files tested and at least one matching file
will result in a label being added.

Fixes actions/labeler#9

* Add support for "AND"-ed matches

A new "rich" matcher object can be provided instead of a normal glob.

The matcher object has two fields that accept an array of globs:
* Globs in "all" must all match every changed file.
* Globs in "some" must all match at least one changed file.

Combined with negated globs, this allows for a precise control of when
labels are applied.

* Rename `some` to `any`

* Update README
2020-06-01 17:01:37 -04:00
PJ Quirk
9984882865 Merge pull request #69 from pjquirk/users/paquirk/ghesfixes
Bumping actions/core and actions/github dependencies for GHES
2020-05-12 16:15:25 -04:00
PJ Quirk
937b16c09f Rerun build/pack 2020-05-12 16:00:39 -04:00
PJ Quirk
e10270bed6 Clarify the build command 2020-05-12 16:00:28 -04:00
PJ Quirk
5aa8259793 Ignore lib files 2020-05-12 16:00:08 -04:00
PJ Quirk
ce29b1babf Fixed build/pack steps to be more predictable 2020-05-12 14:26:07 -04:00
PJ Quirk
06ad9709b1 Bump actions/core to 1.2.4 2020-05-12 14:08:27 -04:00
PJ Quirk
912b1d0ff0 Bumping actions/github to 2.2.0 2020-05-08 17:07:38 -04:00
David Kale
d2c408e7ed V3 preview (#53)
* Covert to use ncc, publish under name Labeler

* Get the filename right
2020-03-05 12:57:26 -05:00
Edward Thomson
58187b6094 Merge pull request #51 from actions/ethomson/docs
Minor doc improvements
2020-02-05 17:32:54 +00:00
Edward Thomson
05785e27d6 README: tweak documentation on token permissions 2020-02-05 17:30:53 +00:00
Josh Goebel
2b75d22987 Explain this action fails for fork/PR model
Resolves #12 via documentation.
2020-02-05 17:27:39 +00:00
Edward Thomson
317937c3d2 Update description 2020-02-05 17:23:08 +00:00
Shawn Napora
1a043751b2 Merge pull request #26 from csi-lk/patch-1
Re-worded readme with clearer examples
2019-10-01 13:42:49 -04:00
Callum Silcock
00584cab2c Reworded readme with clearer examples
* Reformatted readme into headings with some basic rewording
* Added basic and common examples
Resolves #24
2019-09-26 16:53:38 +01:00
Paige Bystrom
df04112348 Updating readme for more guidance (#21)
* updating readme

* updating file path
2019-09-12 13:42:28 -04:00
Shawn Napora
44767181ec Add clarity on GITHUB_TOKEN purpose (#19) 2019-09-09 15:53:57 -04:00
Danny McCormick
0d3cd1e1fd Revert readme changes 2019-08-29 09:59:11 -04:00
Danny McCormick
375fca6b78 Use cron triggers 2019-08-28 10:10:14 -04:00
Jonas Faber
989d3858d8 Fix typo in README.md (#5)
Based on this resource: https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events
2019-08-23 10:24:10 -04:00
Eebs Kobeissi
b726232fd7 Fetch configuration content from PR ref (#8)
* Fetch configuration content from PR ref

Fixes #6

When fetching the configuration content from the file specified by
`configuration-path`, we should load the content from the ref of the PR.

By default, `repos.getContents` will [use the repository's default
branch][1] if no `ref` is specified.

When first configuring this action, assuming the configuration file is
added in the same PR as the action, the configuration file will not
exist on the default branch. This causes an `HttpError: Not Found` to
occur when attempting to load the configuration from the default branch.

This commit updates the call to `getContents` to add the `ref`
parameter, set to the `GITHUB_SHA` value from the context. This will
cause the action to load the contents of the configuration file from the
ref of the PR, rather than the default branch.

---

This PR also updates the packages to use version 1.0.0 of all the
toolkit action packages, as they were using local files before.

I noticed that `src/main.ts` is not formatted according to the prettier
rules. I'm happy to open another PR that applies prettier to the current
source. I had to disable prettier during implementation of this commit
in order to keep the changes relevant to this PR.

[1]: https://developer.github.com/v3/repos/contents/#get-contents

* Remove exec, io, tool-cache
2019-08-23 10:13:22 -04:00
Mike Coutermarsh
d43dfced82 Fix name 2019-08-08 10:59:59 -07:00
Shawn Napora
7d083c498f Update to labeler v2 (#4)
* labeler v2

* update docs
2019-08-08 13:07:40 -04:00
Jonathan Clem
ab3b5b5adc Initial commit v1.0.0 2019-03-29 15:21:48 -07:00