Compare commits

...

62 Commits

Author SHA1 Message Date
Matthew Costabile
a9f041ddd4 Merge pull request #142 from timrogers/timrogers/draft-issue
Allow users to add an issue/PR to a board in a different organization
2022-07-21 08:48:51 -04:00
Matthew Costabile
1809404e28 Merge branch 'main' into timrogers/draft-issue 2022-07-21 08:46:09 -04:00
Lukasz Warchol
0af0b18f28 Merge pull request #157 from actions/non-beta-projects
Remove beta references
2022-07-19 18:11:17 +02:00
Lukasz Warchol
c8dd399614 Remove beta references 2022-07-19 15:00:18 +00:00
Matthew Costabile
f111c2aa36 Merge pull request #156 from actions/dependabot/npm_and_yarn/concurrently-7.3.0
build(deps-dev): bump concurrently from 7.2.2 to 7.3.0
2022-07-19 09:30:12 -04:00
Matthew Costabile
12e917e04c Merge pull request #155 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-5.30.7
build(deps-dev): bump @typescript-eslint/parser from 5.30.6 to 5.30.7
2022-07-19 09:29:58 -04:00
dependabot[bot]
dbe00218fb build(deps-dev): bump concurrently from 7.2.2 to 7.3.0
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 7.2.2 to 7.3.0.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v7.2.2...v7.3.0)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-19 13:26:23 +00:00
dependabot[bot]
fa0b958991 build(deps-dev): bump @typescript-eslint/parser from 5.30.6 to 5.30.7
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.6 to 5.30.7.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.7/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-19 13:26:00 +00:00
Matthew Costabile
f343062b82 Merge pull request #154 from actions/dependabot/npm_and_yarn/types/node-16.11.45
build(deps-dev): bump @types/node from 16.11.44 to 16.11.45
2022-07-18 10:28:07 -04:00
Matthew Costabile
e639bba4f0 Merge pull request #153 from actions/dependabot/npm_and_yarn/eslint-8.20.0
build(deps-dev): bump eslint from 8.19.0 to 8.20.0
2022-07-18 10:27:53 -04:00
dependabot[bot]
34ff2c7db4 build(deps-dev): bump @types/node from 16.11.44 to 16.11.45
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.44 to 16.11.45.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 13:41:32 +00:00
dependabot[bot]
4065956be9 build(deps-dev): bump eslint from 8.19.0 to 8.20.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.19.0 to 8.20.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.19.0...v8.20.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-18 13:41:25 +00:00
dependabot[bot]
9b0fd13e3f build(deps-dev): bump @types/node from 16.11.43 to 16.11.44 (#151)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.43 to 16.11.44.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-15 10:59:26 -03:00
dependabot[bot]
53d95574f4 build(deps-dev): bump eslint-plugin-jest from 26.5.3 to 26.6.0 (#152)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 26.5.3 to 26.6.0.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v26.5.3...v26.6.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-15 10:57:38 -03:00
Tim Rogers
ebd4dc568a Fix failing tests 2022-07-15 11:26:04 +01:00
Tim Rogers
9115f344bd Allow users to add an issue/PR to a board in a different organization
At present, this Action only supports adding an issue or pull
request to a project in the *same organization* as the issue or
pull request itself.

This removes that limitation. If the issue/pull request and
project have different owners, then instead of directly
creating a project item, we will instead create a "draft issue"
which will be added to the board.

Fixes #74.
2022-07-15 11:26:04 +01:00
Matthew Costabile
31c3cce717 Merge pull request #150 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-5.30.6
build(deps-dev): bump @typescript-eslint/parser from 5.30.5 to 5.30.6
2022-07-13 09:46:10 -04:00
dependabot[bot]
c1795be3bc build(deps-dev): bump @typescript-eslint/parser from 5.30.5 to 5.30.6
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.5 to 5.30.6.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.6/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-13 13:42:38 +00:00
Matthew Costabile
75ae529d21 Merge pull request #148 from actions/dependabot/npm_and_yarn/types/node-16.11.43
build(deps-dev): bump @types/node from 16.11.42 to 16.11.43
2022-07-11 08:54:13 -04:00
dependabot[bot]
93eba4a2e5 build(deps-dev): bump @types/node from 16.11.42 to 16.11.43
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.42 to 16.11.43.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 12:52:44 +00:00
Matthew Costabile
5582d9894f Merge pull request #146 from actions/dependabot/npm_and_yarn/eslint-8.19.0
build(deps-dev): bump eslint from 8.18.0 to 8.19.0
2022-07-11 08:52:23 -04:00
Matthew Costabile
97e01d66ef Merge pull request #149 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-5.30.5
build(deps-dev): bump @typescript-eslint/parser from 5.30.0 to 5.30.5
2022-07-11 08:51:45 -04:00
dependabot[bot]
2a4deb3f9f build(deps-dev): bump @typescript-eslint/parser from 5.30.0 to 5.30.5
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.30.0 to 5.30.5.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.5/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 13:37:49 +00:00
dependabot[bot]
458653506b build(deps-dev): bump eslint from 8.18.0 to 8.19.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.18.0 to 8.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.18.0...v8.19.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 13:38:12 +00:00
Matthew Costabile
322721b8cd Merge pull request #144 from actions/dependabot/npm_and_yarn/eslint-plugin-prettier-4.2.1
build(deps-dev): bump eslint-plugin-prettier from 4.1.0 to 4.2.1
2022-06-30 09:48:11 -04:00
Matthew Costabile
601b150078 Merge pull request #145 from actions/dependabot/npm_and_yarn/types/node-16.11.42
build(deps-dev): bump @types/node from 16.11.41 to 16.11.42
2022-06-30 09:44:56 -04:00
dependabot[bot]
665443b5d9 build(deps-dev): bump @types/node from 16.11.41 to 16.11.42
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.41 to 16.11.42.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 13:35:58 +00:00
dependabot[bot]
caae605ffb build(deps-dev): bump eslint-plugin-prettier from 4.1.0 to 4.2.1
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 4.1.0 to 4.2.1.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v4.1.0...v4.2.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 13:35:47 +00:00
Matthew Costabile
5d3a082e24 Merge pull request #143 from actions/fix-tests
fix tests to account for api change
2022-06-30 09:21:52 -04:00
Matthew Costabile
80b198ce77 fix tests to account for api change 2022-06-30 13:13:58 +00:00
Matthew Costabile
92eaaeabac Merge pull request #138 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-5.30.0
build(deps-dev): bump @typescript-eslint/parser from 5.29.0 to 5.30.0
2022-06-28 09:47:01 -04:00
Matthew Costabile
8eedaeb3f8 Merge pull request #137 from actions/dependabot/npm_and_yarn/eslint-plugin-prettier-4.1.0
build(deps-dev): bump eslint-plugin-prettier from 4.0.0 to 4.1.0
2022-06-28 09:46:43 -04:00
dependabot[bot]
3b83e6acf9 build(deps-dev): bump @typescript-eslint/parser from 5.29.0 to 5.30.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.29.0 to 5.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.30.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 13:36:40 +00:00
dependabot[bot]
0bf2f64851 build(deps-dev): bump eslint-plugin-prettier from 4.0.0 to 4.1.0
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 13:36:28 +00:00
Lukasz Warchol
ce9d751c8c Update legacy version reference in the Readme 2022-06-28 14:21:39 +02:00
Lukasz Warchol
2b841e5b72 Merge pull request #105 from lukewar/graphql/projectv2
Update Action to use new ProjectsV2 api
2022-06-28 14:05:29 +02:00
Lukasz Warchol
7ca6a73a54 Update examples to point at release version 2022-06-28 09:33:15 +00:00
Lukasz Warchol
79db2f4851 Update readme to mention right scopes needed by this action 2022-06-28 09:31:09 +00:00
Lukasz Warchol
cf1add2ac3 Rebuild after re-installing packages. 2022-06-27 15:09:31 +00:00
Lukasz Warchol
50a0a4c60e Revert package version 2022-06-27 15:05:39 +00:00
Lukasz Warchol
ed9ec99956 Merge branch 'main' into graphql/projectv2 2022-06-27 14:53:57 +00:00
Lukasz Warchol
79316c3c93 Build and package
Setting pckage version
2022-06-27 13:19:25 +00:00
Lukasz Warchol
2914167b9b Apply suggestions from code review
Co-authored-by: Matt B <9885259+Mattamorphic@users.noreply.github.com>
2022-06-27 15:01:14 +02:00
Matthew Costabile
7334092ecc Merge pull request #136 from akashivskyy/lowercase-labels
Perform case-insensitive comparison
2022-06-22 10:45:43 -04:00
Matthew Costabile
aeb80ee3ca Merge pull request #135 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-5.29.0
build(deps-dev): bump @typescript-eslint/parser from 5.28.0 to 5.29.0
2022-06-22 10:44:13 -04:00
Adrian Kashivskyy
a1e8057254 Run the build 2022-06-22 16:26:05 +02:00
Adrian Kashivskyy
94b35fc3df Add test 2022-06-22 15:33:54 +02:00
Adrian Kashivskyy
188881c8fc Compare lowercase labels 2022-06-22 15:33:07 +02:00
dependabot[bot]
555ebcb094 build(deps-dev): bump @typescript-eslint/parser from 5.28.0 to 5.29.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.28.0 to 5.29.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.29.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-21 13:27:55 +00:00
Matthew Costabile
73cb31d05f Merge pull request #133 from actions/dependabot/npm_and_yarn/eslint-8.18.0
build(deps-dev): bump eslint from 8.17.0 to 8.18.0
2022-06-20 21:26:40 -04:00
Matthew Costabile
88c4df44ff Merge pull request #134 from actions/dependabot/npm_and_yarn/typescript-4.7.4
build(deps-dev): bump typescript from 4.7.3 to 4.7.4
2022-06-20 09:41:42 -04:00
dependabot[bot]
bbdd7d7680 build(deps-dev): bump typescript from 4.7.3 to 4.7.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.7.3 to 4.7.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.7.3...v4.7.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-20 13:39:22 +00:00
dependabot[bot]
6e2d6ef546 build(deps-dev): bump eslint from 8.17.0 to 8.18.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.17.0 to 8.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.17.0...v8.18.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-20 13:38:41 +00:00
Matthew Costabile
a412549585 Merge pull request #110 from actions/dependabot/npm_and_yarn/vercel/ncc-0.34.0
build(deps-dev): bump @vercel/ncc from 0.33.4 to 0.34.0
2022-06-17 08:39:50 -04:00
Matthew Costabile
fedaa03863 update cache 2022-06-17 12:37:10 +00:00
Matthew Costabile
5152387edb update versions 2022-06-17 12:26:43 +00:00
dependabot[bot]
10552f6f89 build(deps-dev): bump @vercel/ncc from 0.33.4 to 0.34.0
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.33.4 to 0.34.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.33.4...0.34.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-17 12:24:38 +00:00
Lukasz Warchol
53101abf47 Build and package 2022-06-02 15:28:56 +00:00
Lukasz Warchol
0c1e36ed75 Update Readme to point the users of the deprecated API to version 0.0.3
Remove feature flags header as it will not be needed after API is released.
2022-06-02 14:59:09 +00:00
Lukasz Warchol
1664cea4b1 Fixing misplacement of headers 2022-05-20 12:48:37 +00:00
Lukasz Warchol
58dc7efeb3 Build and package 2022-05-20 12:24:18 +00:00
Lukasz Warchol
8bc56cd807 Update Action to use new ProjectsV2 api
ProjectsNext API is going to be deprecated in favour of new ProjectsV2.
2022-05-20 12:22:44 +00:00
13 changed files with 1374 additions and 641 deletions

View File

@@ -18,3 +18,5 @@ jobs:
npm install
- run: |
npm run build
- run: |
npm run test

View File

@@ -1,6 +1,6 @@
---
name: '@actions/core'
version: 1.6.0
version: 1.9.0
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core

View File

@@ -1,6 +1,6 @@
---
name: '@actions/github'
version: 5.0.0
version: 5.0.3
type: npm
summary: Actions github lib
homepage: https://github.com/actions/toolkit/tree/main/packages/github

View File

@@ -1,9 +1,9 @@
---
name: '@actions/http-client'
version: 1.0.11
version: 2.0.1
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/http-client#readme
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,6 +1,6 @@
---
name: '@octokit/core'
version: 3.5.1
version: 3.6.0
type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs
homepage:

View File

@@ -1,17 +1,13 @@
# actions/add-to-project
Use this action to automatically add the current issue or pull request to a GitHub project.
Note that this is for [GitHub projects
(beta)](https://docs.github.com/en/issues/trying-out-the-new-projects-experience/about-projects),
not the original GitHub projects.
Use this action to automatically add the current issue or pull request to a [GitHub project](https://docs.github.com/en/issues/trying-out-the-new-projects-experience/about-projects).
Note that this action does not support [GitHub projects (classic)](https://docs.github.com/en/issues/organizing-your-work-with-project-boards).
## Current Status
[![build-test](https://github.com/actions/add-to-project/actions/workflows/test.yml/badge.svg)](https://github.com/actions/add-to-project/actions/workflows/test.yml)
🚨 **This action is in beta, however the API is stable. Some breaking changes might occur between versions, but it is not likely to break as long as you use a specific SHA or version number** 🚨
> **NOTE:** This Action (currently) only supports auto-adding Issues to a Project which lives in the same organization as your target Repository.
> **NOTE:** ⚠️ This action no longer uses the deprecated ProjectNext API. If you are looking for the old version of that action, use version [v0.0.5](https://github.com/actions/add-to-project/releases/tag/v0.0.5).
## Usage
@@ -23,7 +19,9 @@ Create a workflow that runs when Issues or Pull Requests are opened or labeled i
Once you've configured your workflow, save it as a `.yml` file in your target Repository's `.github/workflows` directory.
##### Example Usage: Issue opened with labels `bug` OR `needs-triage`
### Examples
#### Example Usage: Issue opened with labels `bug` OR `needs-triage`
```yaml
name: Add bugs to bugs project
@@ -38,15 +36,17 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
- uses: actions/add-to-project@RELEASE_VERSION
with:
# You can target a repository in a different organization
# to the issue
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: bug, needs-triage
label-operator: OR
```
##### Example Usage: Adds all issues opened that do not include the label `bug` OR `needs-triage`
#### Example Usage: Adds all issues opened that do not include the label `bug` OR `needs-triage`
```yaml
name: Adds all issues that don't include the 'bug' or 'needs-triage' labels to project board
@@ -61,7 +61,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
- uses: actions/add-to-project@RELEASE_VERSION
with:
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
@@ -69,7 +69,7 @@ jobs:
label-operator: NOT
```
##### Example Usage: Pull Requests labeled with `needs-review` and `size/XL`
#### Example Usage: Pull Requests labeled with `needs-review` and `size/XL`
```yaml
name: Add needs-review and size/XL pull requests to projects
@@ -84,7 +84,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
- uses: actions/add-to-project@RELEASE_VERSION
with:
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
@@ -92,22 +92,29 @@ jobs:
label-operator: AND
```
#### Further reading and additional resources
### Further reading and additional resources
- [Inputs](#inputs)
- [Supported Events](#supported-events)
- [How to point the action to a specific branch or commit sha](#how-to-point-the-action-to-a-specific-branch-or-commit-sha)
- [Creating a PAT and adding it to your repository](#creating-a-pat-and-adding-it-to-your-repository)
- [Development](#development)
- [Publish to a distribution branch](#publish-to-a-distribution-branch)
- [actions/add-to-project](#actionsadd-to-project)
- [Current Status](#current-status)
- [Usage](#usage)
- [Examples](#examples)
- [Example Usage: Issue opened with labels `bug` OR `needs-triage`](#example-usage-issue-opened-with-labels-bug-or-needs-triage)
- [Example Usage: Adds all issues opened that do not include the label `bug` OR `needs-triage`](#example-usage-adds-all-issues-opened-that-do-not-include-the-label-bug-or-needs-triage)
- [Example Usage: Pull Requests labeled with `needs-review` and `size/XL`](#example-usage-pull-requests-labeled-with-needs-review-and-sizexl)
- [Further reading and additional resources](#further-reading-and-additional-resources)
- [Inputs](#inputs)
- [Supported Events](#supported-events)
- [Creating a PAT and adding it to your repository](#creating-a-pat-and-adding-it-to-your-repository)
- [Development](#development)
- [Publish to a distribution branch](#publish-to-a-distribution-branch)
- [License](#license)
## Inputs
- <a name="project-url">`project-url`</a> **(required)** is the URL of the GitHub project to add issues to.
- <a name="project-url">`project-url`</a> **(required)** is the URL of the GitHub project to add issues to.
_eg: `https://github.com/orgs|users/<ownerName>/projects/<projectNumber>`_
- <a name="github-token">`github-token`</a> **(required)** is a [personal access
token](https://github.com/settings/tokens/new) with the `repo`, `write:org` and
`read:org` scopes.
token](https://github.com/settings/tokens/new) with `repo` and `project` scopes.
_See [Creating a PAT and adding it to your repository](#creating-a-pat-and-adding-it-to-your-repository) for more details_
- <a name="labeled">`labeled`</a> **(optional)** is a comma-separated list of labels used to filter applicable issues. When this key is provided, an issue must have _one_ of the labels in the list to be added to the project. Omitting this key means that any issue will be added.
- <a name="labeled">`label-operator`</a> **(optional)** is the behavior of the labels filter, either `AND`, `OR` or `NOT` that controls if the issue should be matched with `all` `labeled` input or any of them, default is `OR`.
@@ -127,44 +134,13 @@ and the following [`pull_request` events](https://docs.github.com/en/actions/usi
Using these events ensure that a given issue or pull request, in the workflow's repo, is added to the [specified project](#project-url). If [labeled input(s)](#labeled) are defined, then issues will only be added if they contain at least _one_ of the labels in the list.
## How to point the action to a specific branch or commit sha
Pointing to a branch name generally isn't the safest way to refer to an action, but this is how you can use this action now before we've begun creating releases.
```yaml
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
```
Another option would be to point to a full [commit SHA](https://docs.github.com/en/get-started/quickstart/github-glossary#commit):
```yaml
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@<commitSHA>
with:
project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
```
## Creating a PAT and adding it to your repository
- create a new [personal access
token](https://github.com/settings/tokens/new) with `repo`, `write:org` and
`read:org` scopes
token](https://github.com/settings/tokens/new) with `repo` and `project` scopes
_See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_
- add the newly created PAT as a repository secret, this secret will be referenced by the [github-token input](#github-token)
- add the newly created PAT as a repository secret, this secret will be referenced by the [github-token input](#github-token)
_See [Encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for more information_
## Development

View File

@@ -1,5 +1,6 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
import {addToProject, mustGetOwnerTypeQuery} from '../src/add-to-project'
describe('addToProject', () => {
@@ -11,7 +12,7 @@ describe('addToProject', () => {
beforeEach(() => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token'
})
@@ -23,46 +24,19 @@ describe('addToProject', () => {
jest.restoreAllMocks()
})
test('adds an issue to the project', async () => {
mockGraphQL(
{
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
}
}
}
},
{
test: /addProjectNextItem/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
}
}
}
}
)
await addToProject()
expect(outputs.itemId).toEqual('project-next-item-id')
})
test('adds matching issues with a label filter without label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new'
})
test('adds an issue from the same organization to the project', async () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}]
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -71,18 +45,18 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
@@ -91,12 +65,106 @@ describe('addToProject', () => {
await addToProject()
expect(outputs.itemId).toEqual('project-next-item-id')
expect(outputs.itemId).toEqual('project-item-id')
})
test('adds an issue from a different organization to the project', async () => {
github.context.payload = {
issue: {
number: 2221,
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/octokit/octokit.js/issues/2221'
},
repository: {
name: 'octokit.js',
owner: {
login: 'octokit'
}
}
}
mockGraphQL(
{
test: /getProject/,
return: {
organization: {
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectV2DraftIssue/,
return: {
addProjectV2DraftIssue: {
projectItem: {
id: 'project-item-id'
}
}
}
}
)
await addToProject()
expect(outputs.itemId).toEqual('project-item-id')
})
test('adds matching issues with a label filter without label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new'
})
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
mockGraphQL(
{
test: /getProject/,
return: {
organization: {
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectV2ItemById/,
return: {
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
}
)
await addToProject()
expect(outputs.itemId).toEqual('project-item-id')
})
test('adds matching pull-requests with a label filter without label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new'
})
@@ -105,7 +173,15 @@ describe('addToProject', () => {
// eslint-disable-next-line camelcase
pull_request: {
number: 1,
labels: [{name: 'bug'}]
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/pull/136'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -114,18 +190,18 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
@@ -134,12 +210,12 @@ describe('addToProject', () => {
await addToProject()
expect(outputs.itemId).toEqual('project-next-item-id')
expect(outputs.itemId).toEqual('project-item-id')
})
test('does not add un-matching issues with a label filter without label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug'
})
@@ -147,7 +223,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: []
labels: [],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -160,7 +244,7 @@ describe('addToProject', () => {
test('adds matching issues with labels filter with AND label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new',
'label-operator': 'AND'
@@ -169,7 +253,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}, {name: 'new'}]
labels: [{name: 'bug'}, {name: 'new'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -178,18 +270,18 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
@@ -198,12 +290,12 @@ describe('addToProject', () => {
await addToProject()
expect(outputs.itemId).toEqual('project-next-item-id')
expect(outputs.itemId).toEqual('project-item-id')
})
test('does not add un-matching issues with labels filter with AND label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new',
'label-operator': 'AND'
@@ -212,7 +304,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}, {name: 'other'}]
labels: [{name: 'bug'}, {name: 'other'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -225,7 +325,7 @@ describe('addToProject', () => {
test('does not add matching issues with labels filter with NOT label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new',
'label-operator': 'NOT'
@@ -234,7 +334,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}]
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -247,7 +355,7 @@ describe('addToProject', () => {
test('adds issues that do not have labels present in the label list with NOT label-operator', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new',
'label-operator': 'NOT'
@@ -256,7 +364,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'other'}]
labels: [{name: 'other'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -265,17 +381,17 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
projectV2: {
id: 'project-next-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
addProjectV2ItemById: {
item: {
id: 'project-next-item-id'
}
}
@@ -290,7 +406,7 @@ describe('addToProject', () => {
test('adds matching issues with multiple label filters', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'accessibility,backend,bug'
})
@@ -298,7 +414,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'accessibility'}, {name: 'backend'}]
labels: [{name: 'accessibility'}, {name: 'backend'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -307,18 +431,18 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
@@ -330,13 +454,15 @@ describe('addToProject', () => {
await addToProject()
expect(gqlMock).toHaveBeenCalled()
expect(infoSpy).not.toHaveBeenCalled()
expect(outputs.itemId).toEqual('project-next-item-id')
expect(infoSpy).toHaveBeenCalledWith('Creating project item')
// We shouldn't have any logs relating to the issue being skipped
expect(infoSpy.mock.calls.length).toEqual(1)
expect(outputs.itemId).toEqual('project-item-id')
})
test('does not add un-matching issues with multiple label filters', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'accessibility, backend, bug'
})
@@ -344,7 +470,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'data'}, {name: 'frontend'}, {name: 'improvement'}]
labels: [{name: 'data'}, {name: 'frontend'}, {name: 'improvement'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -359,7 +493,7 @@ describe('addToProject', () => {
test('handles spaces and extra commas gracefully in label filter input', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'accessibility , backend ,, . , bug'
})
@@ -368,7 +502,15 @@ describe('addToProject', () => {
issue: {
number: 1,
labels: [{name: 'accessibility'}, {name: 'backend'}, {name: 'bug'}],
'label-operator': 'AND'
'label-operator': 'AND',
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -377,18 +519,18 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
@@ -400,8 +542,10 @@ describe('addToProject', () => {
await addToProject()
expect(gqlMock).toHaveBeenCalled()
expect(infoSpy).not.toHaveBeenCalled()
expect(outputs.itemId).toEqual('project-next-item-id')
expect(infoSpy).toHaveBeenCalledWith('Creating project item')
// We shouldn't have any logs relating to the issue being skipped
expect(infoSpy.mock.calls.length).toEqual(1)
expect(outputs.itemId).toEqual('project-item-id')
})
test(`throws an error when url isn't a valid project url`, async () => {
@@ -413,7 +557,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: []
labels: [],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -435,7 +587,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: []
labels: [],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -450,7 +610,7 @@ describe('addToProject', () => {
test('constructs the correct graphQL query given an organization owner', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/github/projects/1',
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'bug, new'
})
@@ -458,7 +618,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}]
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
@@ -467,18 +635,18 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
id: 'project-next-id'
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
id: 'project-next-item-id'
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
@@ -487,8 +655,8 @@ describe('addToProject', () => {
await addToProject()
expect(gqlMock).toHaveBeenNthCalledWith(1, expect.stringContaining('organization(login: $ownerName)'), {
ownerName: 'github',
expect(gqlMock).toHaveBeenNthCalledWith(1, expect.stringContaining('organization(login: $projectOwnerName)'), {
projectOwnerName: 'actions',
projectNumber: 1
})
})
@@ -503,7 +671,15 @@ describe('addToProject', () => {
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'bug'}]
labels: [{name: 'bug'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/monalisa/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'monalisa'
}
}
}
@@ -512,17 +688,71 @@ describe('addToProject', () => {
test: /getProject/,
return: {
organization: {
projectNext: {
projectV2: {
id: 'project-id'
}
}
}
},
{
test: /addProjectV2ItemById/,
return: {
addProjectV2ItemById: {
item: {
id: 'project-item-id'
}
}
}
}
)
await addToProject()
expect(gqlMock).toHaveBeenNthCalledWith(1, expect.stringContaining('user(login: $projectOwnerName)'), {
projectOwnerName: 'monalisa',
projectNumber: 1
})
})
test('compares labels case-insensitively', async () => {
mockGetInput({
'project-url': 'https://github.com/orgs/actions/projects/1',
'github-token': 'gh_token',
labeled: 'FOO, Bar, baz',
'label-operator': 'AND'
})
github.context.payload = {
issue: {
number: 1,
labels: [{name: 'foo'}, {name: 'BAR'}, {name: 'baz'}],
// eslint-disable-next-line camelcase
html_url: 'https://github.com/actions/add-to-project/issues/74'
},
repository: {
name: 'add-to-project',
owner: {
login: 'actions'
}
}
}
mockGraphQL(
{
test: /getProject/,
return: {
organization: {
projectV2: {
id: 'project-next-id'
}
}
}
},
{
test: /addProjectNextItem/,
test: /addProjectV2ItemById/,
return: {
addProjectNextItem: {
projectNextItem: {
addProjectV2ItemById: {
item: {
id: 'project-next-item-id'
}
}
@@ -532,10 +762,7 @@ describe('addToProject', () => {
await addToProject()
expect(gqlMock).toHaveBeenNthCalledWith(1, expect.stringContaining('user(login: $ownerName)'), {
ownerName: 'monalisa',
projectNumber: 1
})
expect(outputs.itemId).toEqual('project-next-item-id')
})
})

View File

@@ -1,5 +1,5 @@
name: Add To GitHub Projects Beta
description: Automatically add issues and PRs to GitHub projects beta
name: Add To GitHub projects
description: Automatically add issues and PRs to GitHub projects
author: GitHub
branding:
icon: table

1050
dist/index.js generated vendored

File diff suppressed because it is too large Load Diff

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

274
package-lock.json generated
View File

@@ -9,24 +9,24 @@
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0"
"@actions/core": "^1.9.0",
"@actions/github": "^5.0.3"
},
"devDependencies": {
"@github/prettier-config": "^0.0.4",
"@types/jest": "^27.5.0",
"@types/node": "~16.11.41",
"@typescript-eslint/parser": "^5.28.0",
"@vercel/ncc": "^0.33.4",
"concurrently": "^7.2.2",
"eslint": "^8.17.0",
"@types/node": "~16.11.45",
"@typescript-eslint/parser": "^5.30.7",
"@vercel/ncc": "^0.34.0",
"concurrently": "^7.3.0",
"eslint": "^8.20.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-jest": "^26.6.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^27.5.1",
"prettier": "2.7.1",
"ts-jest": "^27.1.4",
"typescript": "^4.7.3"
"typescript": "^4.7.4"
},
"engines": {
"node": ">=16.0.0 <17.0.0",
@@ -34,30 +34,30 @@
}
},
"node_modules/@actions/core": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.0.tgz",
"integrity": "sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA==",
"dependencies": {
"@actions/http-client": "^1.0.11"
"@actions/http-client": "^2.0.1"
}
},
"node_modules/@actions/github": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.3.tgz",
"integrity": "sha512-myjA/pdLQfhUGLtRZC/J4L1RXOG4o6aYdiEq+zr5wVVKljzbFld+xv10k1FX6IkIJtNxbAq44BdwSNpQ015P0A==",
"dependencies": {
"@actions/http-client": "^1.0.11",
"@octokit/core": "^3.4.0",
"@octokit/plugin-paginate-rest": "^2.13.3",
"@octokit/plugin-rest-endpoint-methods": "^5.1.1"
"@actions/http-client": "^2.0.1",
"@octokit/core": "^3.6.0",
"@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
}
},
"node_modules/@actions/http-client": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": {
"tunnel": "0.0.6"
"tunnel": "^0.0.6"
}
},
"node_modules/@babel/code-frame": {
@@ -1151,13 +1151,13 @@
}
},
"node_modules/@octokit/core": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
"dependencies": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.0",
"@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
@@ -1367,9 +1367,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "16.11.41",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.41.tgz",
"integrity": "sha512-mqoYK2TnVjdkGk8qXAVGc/x9nSaTpSrFaGFm43BUH3IdoBV0nta6hYaGmdOvIMlbHJbUEVen3gvwpwovAZKNdQ==",
"version": "16.11.45",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.45.tgz",
"integrity": "sha512-3rKg/L5x0rofKuuUt5zlXzOnKyIHXmIu5R8A0TuNDMF2062/AOIDBciFIjToLEJ/9F9DzkHNot+BpNsMI1OLdQ==",
"dev": true
},
"node_modules/@types/prettier": {
@@ -1448,14 +1448,14 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.28.0.tgz",
"integrity": "sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.7.tgz",
"integrity": "sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "5.28.0",
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/typescript-estree": "5.28.0",
"@typescript-eslint/scope-manager": "5.30.7",
"@typescript-eslint/types": "5.30.7",
"@typescript-eslint/typescript-estree": "5.30.7",
"debug": "^4.3.4"
},
"engines": {
@@ -1475,13 +1475,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz",
"integrity": "sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz",
"integrity": "sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/visitor-keys": "5.28.0"
"@typescript-eslint/types": "5.30.7",
"@typescript-eslint/visitor-keys": "5.30.7"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1492,9 +1492,9 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.28.0.tgz",
"integrity": "sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.7.tgz",
"integrity": "sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1505,13 +1505,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz",
"integrity": "sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz",
"integrity": "sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/visitor-keys": "5.28.0",
"@typescript-eslint/types": "5.30.7",
"@typescript-eslint/visitor-keys": "5.30.7",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -1532,12 +1532,12 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz",
"integrity": "sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz",
"integrity": "sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/types": "5.30.7",
"eslint-visitor-keys": "^3.3.0"
},
"engines": {
@@ -1725,9 +1725,9 @@
}
},
"node_modules/@vercel/ncc": {
"version": "0.33.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz",
"integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==",
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
@@ -2263,9 +2263,9 @@
"dev": true
},
"node_modules/concurrently": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-7.2.2.tgz",
"integrity": "sha512-DcQkI0ruil5BA/g7Xy3EWySGrFJovF5RYAYxwGvv9Jf9q9B1v3jPFP2tl6axExNf1qgF30kjoNYrangZ0ey4Aw==",
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-7.3.0.tgz",
"integrity": "sha512-IiDwm+8DOcFEInca494A8V402tNTQlJaYq78RF2rijOrKEk/AOHTxhN4U1cp7GYKYX5Q6Ymh1dLTBlzIMN0ikA==",
"dev": true,
"dependencies": {
"chalk": "^4.1.0",
@@ -2659,9 +2659,9 @@
}
},
"node_modules/eslint": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz",
"integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==",
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz",
"integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==",
"dev": true,
"dependencies": {
"@eslint/eslintrc": "^1.3.0",
@@ -2901,9 +2901,9 @@
"dev": true
},
"node_modules/eslint-plugin-jest": {
"version": "26.5.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.5.3.tgz",
"integrity": "sha512-sICclUqJQnR1bFRZGLN2jnSVsYOsmPYYnroGCIMVSvTS3y8XR3yjzy1EcTQmk6typ5pRgyIWzbjqxK6cZHEZuQ==",
"version": "26.6.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.6.0.tgz",
"integrity": "sha512-f8n46/97ZFdU4KqeQYqO8AEVGIhHWvkpgNBWHH3jrM28/y8llnbf3IjfIKv6p2pZIMinK1PCqbbROxs9Eud02Q==",
"dev": true,
"dependencies": {
"@typescript-eslint/utils": "^5.10.0"
@@ -2934,15 +2934,15 @@
}
},
"node_modules/eslint-plugin-prettier": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
"integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
"integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
"dev": true,
"dependencies": {
"prettier-linter-helpers": "^1.0.0"
},
"engines": {
"node": ">=6.0.0"
"node": ">=12.0.0"
},
"peerDependencies": {
"eslint": ">=7.28.0",
@@ -6201,9 +6201,9 @@
}
},
"node_modules/typescript": {
"version": "4.7.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz",
"integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==",
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -6500,30 +6500,30 @@
},
"dependencies": {
"@actions/core": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.0.tgz",
"integrity": "sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA==",
"requires": {
"@actions/http-client": "^1.0.11"
"@actions/http-client": "^2.0.1"
}
},
"@actions/github": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz",
"integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==",
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.3.tgz",
"integrity": "sha512-myjA/pdLQfhUGLtRZC/J4L1RXOG4o6aYdiEq+zr5wVVKljzbFld+xv10k1FX6IkIJtNxbAq44BdwSNpQ015P0A==",
"requires": {
"@actions/http-client": "^1.0.11",
"@octokit/core": "^3.4.0",
"@octokit/plugin-paginate-rest": "^2.13.3",
"@octokit/plugin-rest-endpoint-methods": "^5.1.1"
"@actions/http-client": "^2.0.1",
"@octokit/core": "^3.6.0",
"@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
}
},
"@actions/http-client": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "0.0.6"
"tunnel": "^0.0.6"
}
},
"@babel/code-frame": {
@@ -7370,13 +7370,13 @@
}
},
"@octokit/core": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
"requires": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.0",
"@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
@@ -7577,9 +7577,9 @@
"dev": true
},
"@types/node": {
"version": "16.11.41",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.41.tgz",
"integrity": "sha512-mqoYK2TnVjdkGk8qXAVGc/x9nSaTpSrFaGFm43BUH3IdoBV0nta6hYaGmdOvIMlbHJbUEVen3gvwpwovAZKNdQ==",
"version": "16.11.45",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.45.tgz",
"integrity": "sha512-3rKg/L5x0rofKuuUt5zlXzOnKyIHXmIu5R8A0TuNDMF2062/AOIDBciFIjToLEJ/9F9DzkHNot+BpNsMI1OLdQ==",
"dev": true
},
"@types/prettier": {
@@ -7638,41 +7638,41 @@
}
},
"@typescript-eslint/parser": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.28.0.tgz",
"integrity": "sha512-ekqoNRNK1lAcKhZESN/PdpVsWbP9jtiNqzFWkp/yAUdZvJalw2heCYuqRmM5eUJSIYEkgq5sGOjq+ZqsLMjtRA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.7.tgz",
"integrity": "sha512-Rg5xwznHWWSy7v2o0cdho6n+xLhK2gntImp0rJroVVFkcYFYQ8C8UJTSuTw/3CnExBmPjycjmUJkxVmjXsld6A==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "5.28.0",
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/typescript-estree": "5.28.0",
"@typescript-eslint/scope-manager": "5.30.7",
"@typescript-eslint/types": "5.30.7",
"@typescript-eslint/typescript-estree": "5.30.7",
"debug": "^4.3.4"
},
"dependencies": {
"@typescript-eslint/scope-manager": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.28.0.tgz",
"integrity": "sha512-LeBLTqF/he1Z+boRhSqnso6YrzcKMTQ8bO/YKEe+6+O/JGof9M0g3IJlIsqfrK/6K03MlFIlycbf1uQR1IjE+w==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.7.tgz",
"integrity": "sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/visitor-keys": "5.28.0"
"@typescript-eslint/types": "5.30.7",
"@typescript-eslint/visitor-keys": "5.30.7"
}
},
"@typescript-eslint/types": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.28.0.tgz",
"integrity": "sha512-2OOm8ZTOQxqkPbf+DAo8oc16sDlVR5owgJfKheBkxBKg1vAfw2JsSofH9+16VPlN9PWtv8Wzhklkqw3k/zCVxA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.7.tgz",
"integrity": "sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.28.0.tgz",
"integrity": "sha512-9GX+GfpV+F4hdTtYc6OV9ZkyYilGXPmQpm6AThInpBmKJEyRSIjORJd1G9+bknb7OTFYL+Vd4FBJAO6T78OVqA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.7.tgz",
"integrity": "sha512-tNslqXI1ZdmXXrHER83TJ8OTYl4epUzJC0aj2i4DMDT4iU+UqLT3EJeGQvJ17BMbm31x5scSwo3hPM0nqQ1AEA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/visitor-keys": "5.28.0",
"@typescript-eslint/types": "5.30.7",
"@typescript-eslint/visitor-keys": "5.30.7",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -7681,12 +7681,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.28.0.tgz",
"integrity": "sha512-BtfP1vCor8cWacovzzPFOoeW4kBQxzmhxGoOpt0v1SFvG+nJ0cWaVdJk7cky1ArTcFHHKNIxyo2LLr3oNkSuXA==",
"version": "5.30.7",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.7.tgz",
"integrity": "sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.28.0",
"@typescript-eslint/types": "5.30.7",
"eslint-visitor-keys": "^3.3.0"
}
},
@@ -7797,9 +7797,9 @@
}
},
"@vercel/ncc": {
"version": "0.33.4",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.33.4.tgz",
"integrity": "sha512-ln18hs7dMffelP47tpkaR+V5Tj6coykNyxJrlcmCormPqRQjB/Gv4cu2FfBG+PMzIfdZp2CLDsrrB1NPU22Qhg==",
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true
},
"abab": {
@@ -8204,9 +8204,9 @@
"dev": true
},
"concurrently": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-7.2.2.tgz",
"integrity": "sha512-DcQkI0ruil5BA/g7Xy3EWySGrFJovF5RYAYxwGvv9Jf9q9B1v3jPFP2tl6axExNf1qgF30kjoNYrangZ0ey4Aw==",
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-7.3.0.tgz",
"integrity": "sha512-IiDwm+8DOcFEInca494A8V402tNTQlJaYq78RF2rijOrKEk/AOHTxhN4U1cp7GYKYX5Q6Ymh1dLTBlzIMN0ikA==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
@@ -8504,9 +8504,9 @@
}
},
"eslint": {
"version": "8.17.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.17.0.tgz",
"integrity": "sha512-gq0m0BTJfci60Fz4nczYxNAlED+sMcihltndR8t9t1evnU/azx53x3t2UHXC/uRjcbvRw/XctpaNygSTcQD+Iw==",
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.20.0.tgz",
"integrity": "sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==",
"dev": true,
"requires": {
"@eslint/eslintrc": "^1.3.0",
@@ -8759,9 +8759,9 @@
}
},
"eslint-plugin-jest": {
"version": "26.5.3",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.5.3.tgz",
"integrity": "sha512-sICclUqJQnR1bFRZGLN2jnSVsYOsmPYYnroGCIMVSvTS3y8XR3yjzy1EcTQmk6typ5pRgyIWzbjqxK6cZHEZuQ==",
"version": "26.6.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-26.6.0.tgz",
"integrity": "sha512-f8n46/97ZFdU4KqeQYqO8AEVGIhHWvkpgNBWHH3jrM28/y8llnbf3IjfIKv6p2pZIMinK1PCqbbROxs9Eud02Q==",
"dev": true,
"requires": {
"@typescript-eslint/utils": "^5.10.0"
@@ -8774,9 +8774,9 @@
"dev": true
},
"eslint-plugin-prettier": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
"integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz",
"integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==",
"dev": true,
"requires": {
"prettier-linter-helpers": "^1.0.0"
@@ -11138,9 +11138,9 @@
}
},
"typescript": {
"version": "4.7.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz",
"integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==",
"version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
"dev": true
},
"unbox-primitive": {

View File

@@ -1,11 +1,11 @@
{
"name": "@actions/add-to-project",
"description": "Automatically issues and PRs to GitHub projects",
"description": "Automatically adds issues and PRs to GitHub projects",
"version": "0.0.0",
"author": "GitHub and contributors",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/github": "^5.0.0"
"@actions/core": "^1.9.0",
"@actions/github": "^5.0.3"
},
"engines": {
"node": ">=16.0.0 <17.0.0",
@@ -14,18 +14,18 @@
"devDependencies": {
"@github/prettier-config": "^0.0.4",
"@types/jest": "^27.5.0",
"@types/node": "~16.11.41",
"@typescript-eslint/parser": "^5.28.0",
"@vercel/ncc": "^0.33.4",
"concurrently": "^7.2.2",
"eslint": "^8.17.0",
"@types/node": "~16.11.45",
"@typescript-eslint/parser": "^5.30.7",
"@vercel/ncc": "^0.34.0",
"concurrently": "^7.3.0",
"eslint": "^8.20.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-jest": "^26.6.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^27.5.1",
"prettier": "2.7.1",
"ts-jest": "^27.1.4",
"typescript": "^4.7.3"
"typescript": "^4.7.4"
},
"keywords": [
"actions",

View File

@@ -8,21 +8,29 @@ const urlParse =
interface ProjectNodeIDResponse {
organization?: {
projectNext: {
projectV2: {
id: string
}
}
user?: {
projectNext: {
projectV2: {
id: string
}
}
}
interface ProjectAddItemResponse {
addProjectNextItem: {
projectNextItem: {
addProjectV2ItemById: {
item: {
id: string
}
}
}
interface ProjectV2AddDraftIssueResponse {
addProjectV2DraftIssue: {
projectItem: {
id: string
}
}
@@ -35,14 +43,17 @@ export async function addToProject(): Promise<void> {
core
.getInput('labeled')
.split(',')
.map(l => l.trim())
.map(l => l.trim().toLowerCase())
.filter(l => l.length > 0) ?? []
const labelOperator = core.getInput('label-operator').trim().toLocaleLowerCase()
const octokit = github.getOctokit(ghToken)
const urlMatch = projectUrl.match(urlParse)
const issue = github.context.payload.issue ?? github.context.payload.pull_request
const issueLabels: string[] = (issue?.labels ?? []).map((l: {name: string}) => l.name)
const issueLabels: string[] = (issue?.labels ?? []).map((l: {name: string}) => l.name.toLowerCase())
const issueOwnerName = github.context.payload.repository?.owner.login
core.debug(`Issue/PR owner: ${issueOwnerName}`)
// Ensure the issue matches our `labeled` filter based on the label-operator.
if (labelOperator === 'and') {
@@ -64,60 +75,89 @@ export async function addToProject(): Promise<void> {
core.debug(`Project URL: ${projectUrl}`)
const urlMatch = projectUrl.match(urlParse)
if (!urlMatch) {
throw new Error(
`Invalid project URL: ${projectUrl}. Project URL should match the format https://github.com/<orgs-or-users>/<ownerName>/projects/<projectNumber>`
)
}
const ownerName = urlMatch.groups?.ownerName
const projectOwnerName = urlMatch.groups?.ownerName
const projectNumber = parseInt(urlMatch.groups?.projectNumber ?? '', 10)
const ownerType = urlMatch.groups?.ownerType
const ownerTypeQuery = mustGetOwnerTypeQuery(ownerType)
core.debug(`Org name: ${ownerName}`)
core.debug(`Project owner: ${projectOwnerName}`)
core.debug(`Project number: ${projectNumber}`)
core.debug(`Owner type: ${ownerType}`)
core.debug(`Project owner type: ${ownerType}`)
// First, use the GraphQL API to request the project's node ID.
const idResp = await octokit.graphql<ProjectNodeIDResponse>(
`query getProject($ownerName: String!, $projectNumber: Int!) {
${ownerTypeQuery}(login: $ownerName) {
projectNext(number: $projectNumber) {
`query getProject($projectOwnerName: String!, $projectNumber: Int!) {
${ownerTypeQuery}(login: $projectOwnerName) {
projectV2(number: $projectNumber) {
id
}
}
}`,
{
ownerName,
projectOwnerName,
projectNumber
}
)
const projectId = idResp[ownerTypeQuery]?.projectNext.id
const projectId = idResp[ownerTypeQuery]?.projectV2.id
const contentId = issue?.node_id
core.debug(`Project node ID: ${projectId}`)
core.debug(`Content ID: ${contentId}`)
// Next, use the GraphQL API to add the issue to the project.
const addResp = await octokit.graphql<ProjectAddItemResponse>(
`mutation addIssueToProject($input: AddProjectNextItemInput!) {
addProjectNextItem(input: $input) {
projectNextItem {
id
// If the issue has the same owner as the project, we can directly
// add a project item. Otherwise, we add a draft issue.
if (issueOwnerName === projectOwnerName) {
core.info('Creating project item')
const addResp = await octokit.graphql<ProjectAddItemResponse>(
`mutation addIssueToProject($input: AddProjectV2ItemByIdInput!) {
addProjectV2ItemById(input: $input) {
item {
id
}
}
}`,
{
input: {
projectId,
contentId
}
}
}`,
{
input: {
contentId,
projectId
}
}
)
)
core.setOutput('itemId', addResp.addProjectNextItem.projectNextItem.id)
core.setOutput('itemId', addResp.addProjectV2ItemById.item.id)
} else {
core.info('Creating draft issue in project')
const addResp = await octokit.graphql<ProjectV2AddDraftIssueResponse>(
`mutation addDraftIssueToProject($projectId: ID!, $title: String!) {
addProjectV2DraftIssue(input: {
projectId: $projectId,
title: $title
}) {
projectItem {
id
}
}
}`,
{
projectId,
title: issue?.html_url
}
)
core.setOutput('itemId', addResp.addProjectV2DraftIssue.projectItem.id)
}
}
export function mustGetOwnerTypeQuery(ownerType?: string): 'organization' | 'user' {