Compare commits

...

489 Commits

Author SHA1 Message Date
James M. Greene
d8af841ac3 Merge pull request #288 from actions/use-artifacts-client
Use the Actions artifacts client to avoid needing the `actions: read` permission
2023-12-22 13:31:06 -06:00
James M. Greene
35a0f06cfc Add empty request body for more completeness 2023-12-22 13:27:24 -06:00
James M. Greene
5cba2b1245 Display artifact name in some post-filter error messages 2023-12-22 13:16:13 -06:00
James M. Greene
e03d00b325 Update distributables 2023-12-22 12:53:32 -06:00
James M. Greene
d6fbcf80b1 Log the more raw error message from Twirp 2023-12-22 12:53:15 -06:00
James M. Greene
013b725db3 Oxford commas 2023-12-22 12:52:56 -06:00
James M. Greene
ed0e794532 Minimizing unnecessary differences 2023-12-22 11:47:20 -06:00
James M. Greene
1c0b543596 Remove 'actions: read' permissions from README 2023-12-22 11:42:50 -06:00
James M. Greene
fe3d75dd3a Update distributables 2023-12-22 11:41:22 -06:00
James M. Greene
b3879bac7d Update tests 2023-12-22 11:41:10 -06:00
James M. Greene
72ab98158a Wrap Twirp responses like Octokit responses for consistency 2023-12-22 11:40:57 -06:00
James M. Greene
c704b8a6e2 Remove 'total_count' from fake responses in tests 2023-12-22 11:22:10 -06:00
James M. Greene
02cb90ee32 Update distributables 2023-12-22 09:29:56 -06:00
James M. Greene
88807a7a35 Fix formatting 2023-12-22 09:29:47 -06:00
Jess Bees
e386446c2a Catch artifact-client errors differently from octokit errors 2023-12-22 10:25:57 -05:00
Jess Bees
340b369533 Correct size field in response payload 2023-12-21 18:43:25 -05:00
Jess Bees
4be34033fc Fix *most* tests 2023-12-21 16:10:50 -05:00
Jess Bees
0486580c63 Set the right env variables to get artifacts client to initialize 2023-12-21 14:39:05 -05:00
James M. Greene
af9eaca61c Merge branch 'main' into use-artifacts-client 2023-12-20 10:57:21 -06:00
James M. Greene
81251b551f Use the Actions artifacts client to avoid needing the actions-read permission 2023-12-20 10:56:51 -06:00
James M. Greene
47cf65bf47 Merge pull request #283 from actions/update-readme-for-v4
Update README to reflect v4
2023-12-20 10:40:31 -06:00
Jess Bees
1a1c979b91 clarify GHES compatibility 2023-12-19 12:15:02 -05:00
Jess Bees
925d92be20 clarify actions permission 2023-12-19 12:13:19 -05:00
Jess Bees
b80d7fe30e Update README.md
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
2023-12-19 11:27:25 -05:00
Jess Bees
d724c5069f Update README to reflect v4
* Changes version tag in sample code
* Adds newly required permission
* Notes that v4 isn't compatible with GHES yet
2023-12-19 10:03:19 -05:00
Jess Bees
f33f41b675 Merge pull request #279 from actions/artifacts-next-ga
Use artifacts v4
2023-12-18 20:42:41 -05:00
Jess Bees
0d45f33cde pretty 2023-12-15 10:54:04 -05:00
Jess Bees
d1e23d0efd Merge branch 'main' into artifacts-next-ga 2023-12-15 10:50:33 -05:00
James M. Greene
13b55b33dd Merge pull request #272 from kbdharun/main
chore/docs: update version, fix typos
2023-12-07 09:29:18 -06:00
K.B.Dharun Krishna
c284911fe1 chore/docs: update version, fix typos
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-12-07 16:08:41 +05:30
James M. Greene
ae44070880 Merge pull request #266 from actions/dependabot/npm_and_yarn/eslint-8.55.0
Bump eslint from 8.54.0 to 8.55.0
2023-12-06 23:51:54 -06:00
dependabot[bot]
34a8f6066a Bump eslint from 8.54.0 to 8.55.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.54.0 to 8.55.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.54.0...v8.55.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 05:48:00 +00:00
James M. Greene
b65643c0ab Merge pull request #267 from actions/dependabot/npm_and_yarn/nock-13.4.0
Bump nock from 13.3.8 to 13.4.0
2023-12-06 23:46:31 -06:00
dependabot[bot]
faceed1585 Bump nock from 13.3.8 to 13.4.0
Bumps [nock](https://github.com/nock/nock) from 13.3.8 to 13.4.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.3.8...v13.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 05:41:02 +00:00
James M. Greene
230466c706 Merge pull request #268 from actions/dependabot/npm_and_yarn/eslint-config-prettier-9.1.0
Bump eslint-config-prettier from 9.0.0 to 9.1.0
2023-12-06 23:39:43 -06:00
dependabot[bot]
38d34f8e6f Bump eslint-config-prettier from 9.0.0 to 9.1.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.0.0 to 9.1.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.0.0...v9.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 21:30:21 +00:00
James M. Greene
cd33125d26 Merge pull request #269 from actions/dependabot/npm_and_yarn/actions/core-1.10.1
Bump @actions/core from 1.10.0 to 1.10.1
2023-12-06 15:29:03 -06:00
github-actions[bot]
dd970aea72 Update distributables after Dependabot 🤖 2023-12-06 21:02:33 +00:00
dependabot[bot]
7433d78cba Bump @actions/core from 1.10.0 to 1.10.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.0 to 1.10.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-06 21:02:09 +00:00
James M. Greene
56d63c68a6 Merge pull request #261 from actions/dependabot/npm_and_yarn/actions/github-6.0.0
Bump @actions/github from 5.1.1 to 6.0.0
2023-12-06 15:00:45 -06:00
James M. Greene
1050c5c646 Merge branch 'main' into dependabot/npm_and_yarn/actions/github-6.0.0 2023-12-06 14:57:16 -06:00
James M. Greene
f8e6f4a56d Fix formatting 2023-12-06 14:56:54 -06:00
James M. Greene
b687ea25c8 Fix last test failure 2023-12-06 14:51:36 -06:00
James M. Greene
ccfe503c3f Merge pull request #270 from actions/v3-readme
Update compatibility table for v3
2023-12-06 09:40:25 -06:00
James M. Greene
ed119588ad Stabilize some tests 2023-12-06 01:24:29 -06:00
James M. Greene
a53c6bc7f1 Update distributables 2023-12-06 01:07:52 -06:00
James M. Greene
cc18e529bf Update tests to use undici mocking for latest Octokit 2023-12-06 01:05:59 -06:00
James M. Greene
b751a79e06 Add undici as a devDep 2023-12-06 01:04:50 -06:00
James M. Greene
dda23d18e4 Update compatibility table for v3 2023-12-04 19:42:16 -06:00
James M. Greene
3430969625 Update .node-version 2023-12-03 00:01:26 -06:00
github-actions[bot]
6784dc0464 Update distributables after Dependabot 🤖 2023-12-03 05:44:47 +00:00
dependabot[bot]
89c47f5a13 Bump @actions/github from 5.1.1 to 6.0.0
Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 5.1.1 to 6.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

---
updated-dependencies:
- dependency-name: "@actions/github"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-03 05:44:21 +00:00
James M. Greene
77d7344265 Merge pull request #256 from takost/update-to-node-20
Update action to node20
2023-12-02 23:42:58 -06:00
James M. Greene
84abb89dc5 Merge branch 'main' into update-to-node-20 2023-12-02 06:48:59 -06:00
James M. Greene
de14547edc Merge pull request #264 from actions/dependabot/npm_and_yarn/prettier-3.1.0
Bump prettier from 3.0.0 to 3.1.0
2023-11-29 15:31:50 -06:00
dependabot[bot]
ced2b1a16b Bump prettier from 3.0.0 to 3.1.0
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.0...3.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 21:29:04 +00:00
James M. Greene
3a91181e1b Merge pull request #263 from actions/dependabot/npm_and_yarn/octokit/request-error-5.0.1
Bump @octokit/request-error from 5.0.0 to 5.0.1
2023-11-29 15:27:41 -06:00
dependabot[bot]
6fa14b662d Bump @octokit/request-error from 5.0.0 to 5.0.1
Bumps [@octokit/request-error](https://github.com/octokit/request-error.js) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 20:53:06 +00:00
James M. Greene
f9e640bce0 Merge pull request #262 from actions/dependabot/npm_and_yarn/actions/http-client-2.2.0
Bump @actions/http-client from 2.1.0 to 2.2.0
2023-11-29 14:23:58 -06:00
github-actions[bot]
3eefb79441 Update distributables after Dependabot 🤖 2023-11-29 16:44:57 +00:00
dependabot[bot]
971e36e6ad Bump @actions/http-client from 2.1.0 to 2.2.0
Bumps [@actions/http-client](https://github.com/actions/toolkit/tree/HEAD/packages/http-client) from 2.1.0 to 2.2.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/http-client/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/http-client)

---
updated-dependencies:
- dependency-name: "@actions/http-client"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 16:44:27 +00:00
James M. Greene
6abbee335a Merge pull request #260 from actions/dependabot/npm_and_yarn/vercel/ncc-0.38.1
Bump @vercel/ncc from 0.36.1 to 0.38.1
2023-11-29 10:42:46 -06:00
github-actions[bot]
e149aa9f91 Update distributables after Dependabot 🤖 2023-11-27 18:46:58 +00:00
dependabot[bot]
0077311596 Bump @vercel/ncc from 0.36.1 to 0.38.1
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.36.1 to 0.38.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.36.1...0.38.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-27 18:46:34 +00:00
James M. Greene
03b62d1911 Merge pull request #257 from actions/dependabot/npm_and_yarn/eslint-8.54.0
Bump eslint from 8.44.0 to 8.54.0
2023-11-20 15:22:31 -06:00
dependabot[bot]
ada3f9d061 Bump eslint from 8.44.0 to 8.54.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.44.0 to 8.54.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.44.0...v8.54.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 21:19:50 +00:00
James M. Greene
82b8ae3f91 Merge pull request #254 from actions/dependabot/npm_and_yarn/nock-13.3.8
Bump nock from 13.3.1 to 13.3.8
2023-11-20 15:18:37 -06:00
dependabot[bot]
d183a290bd Bump nock from 13.3.1 to 13.3.8
Bumps [nock](https://github.com/nock/nock) from 13.3.1 to 13.3.8.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.3.1...v13.3.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 21:12:50 +00:00
James M. Greene
8c6ef3d8d5 Merge pull request #246 from actions/dependabot/github_actions/actions/setup-node-4
Bump actions/setup-node from 3 to 4
2023-11-20 15:11:20 -06:00
dependabot[bot]
5a0bbc6e7d Bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 21:09:55 +00:00
James M. Greene
49af2606ad Merge pull request #245 from actions/dependabot/github_actions/release-drafter/release-drafter-5.25.0
Bump release-drafter/release-drafter from 5.24.0 to 5.25.0
2023-11-20 15:08:45 -06:00
dependabot[bot]
8b1057e1ce Bump release-drafter/release-drafter from 5.24.0 to 5.25.0
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.24.0 to 5.25.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](65c5fb495d...09c613e259)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 21:07:11 +00:00
James M. Greene
1f9a7ee304 Merge pull request #232 from actions/dependabot/npm_and_yarn/eslint-plugin-github-4.10.1
Bump eslint-plugin-github from 4.8.0 to 4.10.1
2023-11-20 15:03:58 -06:00
dependabot[bot]
3aff9369e6 Bump eslint-plugin-github from 4.8.0 to 4.10.1
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.8.0 to 4.10.1.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.8.0...v4.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 20:59:36 +00:00
James M. Greene
a3969a1774 Merge pull request #224 from actions/dependabot/npm_and_yarn/jest-29.7.0
Bump jest from 29.6.1 to 29.7.0
2023-11-20 14:58:19 -06:00
dependabot[bot]
d9c5ae4728 Bump jest from 29.6.1 to 29.7.0
Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 29.6.1 to 29.7.0.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v29.7.0/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 20:41:05 +00:00
James M. Greene
94490d3099 Merge pull request #210 from actions/fix-comma
Fix cosmetic error by replacing comma with period
2023-11-20 14:36:48 -06:00
James M. Greene
b2f7f34415 Merge branch 'main' into fix-comma 2023-11-20 14:30:58 -06:00
James M. Greene
dc61a05a4c Merge pull request #220 from actions/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-11-20 14:26:13 -06:00
dependabot[bot]
57dcea9665 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 20:22:37 +00:00
James M. Greene
11d1068b0c Merge pull request #209 from actions/dependabot/npm_and_yarn/eslint-config-prettier-9.0.0
Bump eslint-config-prettier from 8.8.0 to 9.0.0
2023-11-20 14:21:21 -06:00
dependabot[bot]
641f4888c4 Bump eslint-config-prettier from 8.8.0 to 9.0.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.8.0 to 9.0.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.8.0...v9.0.0)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 20:15:30 +00:00
Tatyana Kostromskaya
6c3eed1621 Update action to node20 2023-11-17 12:08:51 +00:00
Jess Bees
125d07c91d Merge pull request #251 from konradpabjan/main
Deploy pages using artifact IDs
2023-11-03 14:07:27 -04:00
Konrad Pabjan
7496661f94 Undo unnecessary reorder 2023-10-30 15:44:53 -04:00
Konrad Pabjan
4279385f7d Add extra test 2023-10-30 15:36:01 -04:00
Konrad Pabjan
a075a5970d Rebuild the dist folder 2023-10-30 15:07:46 -04:00
Konrad Pabjan
b15b65d3e5 Misc tweaks 2023-10-30 15:04:12 -04:00
Konrad Pabjan
fa898e325d Update tests + cleanup 2023-10-30 14:58:12 -04:00
Konrad Pabjan
d45e4be1a6 WIP 2023-10-27 17:52:04 -04:00
Konrad Pabjan
b12897a760 WIP 2023-10-27 17:50:16 -04:00
Konrad Pabjan
499890a085 WIP 2023-10-27 17:40:12 -04:00
Konrad Pabjan
324d9f15de WIP 2023-10-27 17:00:48 -04:00
Konrad Pabjan
2196d013ad WIP 2023-10-27 16:49:22 -04:00
Konrad Pabjan
ce81cfb969 WIP 2023-10-27 16:47:13 -04:00
Konrad Pabjan
da4705cd08 WIP 2023-10-27 16:41:02 -04:00
Konrad Pabjan
961a4a1557 WIP 2023-10-27 16:34:41 -04:00
Konrad Pabjan
38d3e68bdc Build 2023-10-27 16:19:24 -04:00
Konrad Pabjan
08232476b8 WIP 2023-10-27 16:13:35 -04:00
James M. Greene
fa86ad3bc1 Merge pull request #243 from actions/definitely-not-beta
Remove "beta" disclaimer from README
2023-10-18 15:50:57 -05:00
James M. Greene
976abf18ca Remove "beta" disclaimer from README 2023-10-18 14:43:26 -05:00
James M. Greene
377be98d59 Fix cosmetic error by replacing comma with period 2023-08-09 16:02:32 -05:00
Yoann Chaudet
f69bebbdd5 Improve the README on all things artifacts 2023-07-27 22:30:35 -07:00
James M. Greene
9dbe382482 Merge pull request #201 from actions/update-compat-table
Update GHES compatibility table after verifying with `3.9.x`
2023-07-21 01:31:59 -05:00
James M. Greene
96a5bb957b Fix typo 2023-07-20 00:18:22 -05:00
James M. Greene
8458d4c873 Update GHES compatibility table after verifying with 3.9.x 2023-07-20 00:17:35 -05:00
James M. Greene
0fd60c869b Merge pull request #194 from actions/dependabot/npm_and_yarn/octokit/request-error-5.0.0
Bump @octokit/request-error from 4.0.1 to 5.0.0
2023-07-10 16:52:19 -05:00
dependabot[bot]
9f42854283 Bump @octokit/request-error from 4.0.1 to 5.0.0
Bumps [@octokit/request-error](https://github.com/octokit/request-error.js) from 4.0.1 to 5.0.0.
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v4.0.1...v5.0.0)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 21:49:41 +00:00
James M. Greene
935c3f915d Merge pull request #196 from actions/dependabot/npm_and_yarn/prettier-3.0.0
Bump prettier from 2.8.8 to 3.0.0
2023-07-10 16:48:29 -05:00
dependabot[bot]
9c31b72d4a Bump prettier from 2.8.8 to 3.0.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 21:38:04 +00:00
James M. Greene
2b0ca4a2d6 Merge pull request #195 from actions/dependabot/npm_and_yarn/jest-29.6.1
Bump jest from 29.5.0 to 29.6.1
2023-07-10 16:37:21 -05:00
dependabot[bot]
f7b0e1891f Bump jest from 29.5.0 to 29.6.1
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.5.0 to 29.6.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.6.1/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 21:35:26 +00:00
James M. Greene
8b4e85a223 Merge pull request #192 from actions/dependabot/github_actions/release-drafter/release-drafter-5.24.0
Bump release-drafter/release-drafter from 5.23.0 to 5.24.0
2023-07-10 16:24:53 -05:00
dependabot[bot]
cca68c9d4b Bump release-drafter/release-drafter from 5.23.0 to 5.24.0
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.23.0 to 5.24.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](569eb7ee3a...65c5fb495d)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 21:22:30 +00:00
James M. Greene
73a7feb190 Merge pull request #191 from actions/dependabot/npm_and_yarn/eslint-8.44.0
Bump eslint from 8.42.0 to 8.44.0
2023-07-10 16:21:29 -05:00
dependabot[bot]
2457a7fc63 Bump eslint from 8.42.0 to 8.44.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.42.0 to 8.44.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.42.0...v8.44.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-10 21:11:29 +00:00
James M. Greene
a562022ed9 Merge pull request #197 from actions/break-the-circle
Remove circular JSON references for error debugging
2023-07-10 15:03:45 -05:00
James M. Greene
b865ababeb Remove circular JSON references for error debugging 2023-07-10 14:58:49 -05:00
Fabian Aguilar Gomez
12ab2b16cf Merge pull request #187 from actions/update-deploy-error-message
Add error message for file permissions
2023-06-16 13:38:01 -05:00
Fabian Aguilar Gomez
157c090d5a update dist 2023-06-16 15:41:51 +00:00
Fabian Aguilar Gomez
39bfa7a819 Update dist/index.js
Co-authored-by: Mingzi  <yimysty@github.com>
2023-06-16 10:38:43 -05:00
Fabian Aguilar Gomez
cdd88557f6 update index 2023-06-15 22:20:55 +00:00
Fabian Aguilar Gomez
9cf15d70b7 Update deployment.js 2023-06-15 16:57:51 -05:00
James M. Greene
80d8f1cab8 Merge pull request #182 from actions/dependabot/npm_and_yarn/octokit/request-error-4.0.1
Bump @octokit/request-error from 3.0.3 to 4.0.1
2023-06-12 15:55:45 -05:00
github-actions[bot]
ffdf102557 Update distributables after Dependabot 🤖 2023-06-07 16:16:20 +00:00
dependabot[bot]
a1b3914731 Bump @octokit/request-error from 3.0.3 to 4.0.1
Bumps [@octokit/request-error](https://github.com/octokit/request-error.js) from 3.0.3 to 4.0.1.
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v3.0.3...v4.0.1)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 16:14:11 +00:00
James M. Greene
ee48c7b82e Merge pull request #183 from actions/dependabot/npm_and_yarn/eslint-8.42.0
Bump eslint from 8.40.0 to 8.42.0
2023-06-06 09:53:14 -05:00
dependabot[bot]
d9731c4933 Bump eslint from 8.40.0 to 8.42.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.40.0 to 8.42.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.40.0...v8.42.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 14:51:05 +00:00
James M. Greene
90eb49531e Merge pull request #181 from actions/dependabot/npm_and_yarn/eslint-plugin-github-4.8.0
Bump eslint-plugin-github from 4.7.0 to 4.8.0
2023-06-06 09:50:26 -05:00
dependabot[bot]
27cfbcb894 Bump eslint-plugin-github from 4.7.0 to 4.8.0
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.7.0 to 4.8.0.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.7.0...v4.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-06 14:48:34 +00:00
James M. Greene
dc213a7f7d Merge pull request #177 from actions/artifact-size
Check artifact size and warn if too large
2023-06-06 09:47:49 -05:00
James M. Greene
fdbbcdba1c Update distributables (again) 2023-06-06 09:43:48 -05:00
James M. Greene
2c56c1e0f7 Tweak wording 2023-06-06 09:40:22 -05:00
Greta Parks
2fb2bbeb02 Check artifact size and warn if too large 2023-05-22 17:00:13 +00:00
James M. Greene
b580d214b4 Merge pull request #169 from actions/dependabot/npm_and_yarn/eslint-8.40.0
Bump eslint from 8.38.0 to 8.40.0
2023-05-16 12:16:29 -05:00
dependabot[bot]
19e3eb4e0c Bump eslint from 8.38.0 to 8.40.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.38.0 to 8.40.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.38.0...v8.40.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 17:12:07 +00:00
James M. Greene
e3fab2ac01 Merge pull request #167 from actions/dependabot/npm_and_yarn/nock-13.3.1
Bump nock from 13.3.0 to 13.3.1
2023-05-16 12:11:22 -05:00
dependabot[bot]
bc2634f423 Bump nock from 13.3.0 to 13.3.1
Bumps [nock](https://github.com/nock/nock) from 13.3.0 to 13.3.1.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.3.0...v13.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 16:32:08 +00:00
James M. Greene
f4c31b94b1 Merge pull request #159 from actions/dependabot/npm_and_yarn/prettier-2.8.8
Bump prettier from 2.8.7 to 2.8.8
2023-05-16 11:30:50 -05:00
dependabot[bot]
af578d2e40 Bump prettier from 2.8.7 to 2.8.8
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.7 to 2.8.8.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.7...2.8.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-16 16:15:02 +00:00
James M. Greene
8492390532 Merge pull request #170 from actions/timeout-fix
Timeout fix
2023-05-16 11:00:14 -05:00
James M. Greene
2905629ea4 Merge branch 'main' into timeout-fix 2023-05-16 10:28:30 -05:00
James M. Greene
c9a8d971f4 Merge pull request #175 from actions/ghes-warning
Add a support note to the deployment creation error if using GHES
2023-05-16 10:27:08 -05:00
James M. Greene
ff6c51e54c Remove period to avoid messing up URL 2023-05-16 10:15:22 -05:00
James M. Greene
b26c4cb790 Add a support note to the deployment creation error if using GHES 2023-05-16 10:13:05 -05:00
James M. Greene
6b39486d2c Move compatibility table to a less prominent spot 2023-05-15 17:49:07 -05:00
James M. Greene
69cf9b75ca Merge pull request #173 from actions/compat-table
Add GHES compatibility table
2023-05-15 14:32:13 -05:00
James M. Greene
668cc2675f Add a horizontal rule for a visual break 2023-05-15 14:29:46 -05:00
James M. Greene
edaafab71f Add a compatibility note to the release notes generation template 2023-05-15 14:21:12 -05:00
James M. Greene
fb67d78c18 Add a compatibility table to the README 2023-05-15 14:16:47 -05:00
Greta Parks
21b085af5f little rename for nuance 2023-05-12 16:54:50 +00:00
Greta Parks
ccca7e9d96 Some fixes 2023-05-12 16:28:50 +00:00
Greta Parks
c02d64fe5c Revert "fix error count lies and clean up tests a bit"
This reverts commit 3e2c26d7d5.
2023-05-12 15:53:50 +00:00
Greta Parks
dcb366ca66 Update src/internal/deployment.js
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2023-05-12 09:40:31 -06:00
Greta Parks
3e2c26d7d5 fix error count lies and clean up tests a bit 2023-05-11 20:38:18 +00:00
Greta Parks
054faf7e6d enforce a max timeout 2023-05-11 18:39:06 +00:00
Greta Parks
bacaae7379 add warning and test for timeout over maximum 2023-05-09 21:26:22 +00:00
James M. Greene
af48cf94a4 Merge pull request #156 from actions/deprecation-cleanup
Remove deprecated input parameters
2023-04-18 09:59:28 -05:00
James M. Greene
b39c421b98 Remove deprecated input parameters 2023-04-18 01:13:17 -05:00
James M. Greene
176fcdbd0d Merge pull request #155 from actions/classic-grantbirki-driveby
General Repository Improvements
2023-04-18 00:43:13 -05:00
James M. Greene
b8a0d0233e Alphabetize the npm scripts 2023-04-18 00:34:47 -05:00
James M. Greene
31bb4568ea Move coverage badge to root directory 2023-04-18 00:32:50 -05:00
James M. Greene
6657d340c9 Rename 'functions' directory to 'internal' 2023-04-18 00:32:13 -05:00
James M. Greene
efce2761be Revert Actions workflow names since we're overriding in badges 2023-04-18 00:18:00 -05:00
James M. Greene
c77de140c8 Use shields.io for more consistent badges 2023-04-18 00:15:14 -05:00
James M. Greene
0a6b5a09eb Add badge for latest release 2023-04-18 00:04:23 -05:00
James M. Greene
ddf1436b98 Reorder badges 2023-04-17 23:57:32 -05:00
James M. Greene
b463fdb52c Shorten workflow names for better badges 2023-04-17 23:54:37 -05:00
James M. Greene
26c37d6a64 Wording tweak 2023-04-17 23:51:57 -05:00
James M. Greene
16c932f680 Update contribution instructions 2023-04-17 23:51:13 -05:00
James M. Greene
e93f066622 Use real version tag in example usage 2023-04-17 23:41:47 -05:00
James M. Greene
0d1bd15af6 Minor wording update in README 2023-04-17 23:37:32 -05:00
James M. Greene
5aacbeac9b Update README with info on Environment Variables set 2023-04-17 23:35:32 -05:00
James M. Greene
3a8a04e5ad Pin release-drafter action usage since we cannot trust outside orgs 2023-04-17 23:29:20 -05:00
James M. Greene
324f764c2b Unpin actions usage since we trust our own org 2023-04-17 23:27:04 -05:00
James M. Greene
5daf42835f Tidy up comment so Dependabot can update it 2023-04-17 23:26:12 -05:00
James M. Greene
dab0b0f83d Remove unnecessary checkout from release drafting workflow 2023-04-17 23:24:42 -05:00
James M. Greene
a8b1dc44fa Actions naming cleanup/reverts 2023-04-17 23:24:24 -05:00
James M. Greene
20bd69d98b Remove 'ci-test' script in favor of generating coverage badges as part of the 'all' script 2023-04-17 23:18:55 -05:00
James M. Greene
f7c37e718b Remove .eslintignore file in favor of existing .eslintrc.json ignore patterns 2023-04-17 23:17:34 -05:00
James M. Greene
425b204f49 Use node-version-file parameter instead of an extra step 2023-04-14 15:52:00 -05:00
grantbirki
9c5eb6975b remove required test coverage section 2023-04-14 21:32:12 +01:00
grantbirki
c667db85ec bundle 2023-04-14 21:29:15 +01:00
grantbirki
c05cd8b1e8 at least 70% coverage 2023-04-14 21:29:12 +01:00
grantbirki
571bf8a87f catches an error when trying to cancel a deployment - test 2023-04-14 21:26:09 +01:00
grantbirki
36f9337a64 test early exit on a deployment cancel request 2023-04-14 21:20:52 +01:00
grantbirki
c38b3699e6 exits early when deployment is not in progress - test 2023-04-14 21:10:57 +01:00
grantbirki
44c5eaa46e add check when no deployment is found 2023-04-14 21:04:16 +01:00
grantbirki
7b5216ce57 bundle and fmt 2023-04-14 21:01:12 +01:00
grantbirki
5f3aba0651 reduce passing coverage while writing tests 2023-04-14 20:59:23 +01:00
grantbirki
3194543231 update tests 2023-04-14 20:58:13 +01:00
grantbirki
515e39edbf structuring tests and functions 2023-04-14 20:43:44 +01:00
grantbirki
dbac87a7c1 new lines 2023-04-13 23:34:29 +01:00
grantbirki
f0789de653 structure readme 2023-04-13 23:26:36 +01:00
grantbirki
b98f9c9766 add inputs and outputs to the readme 2023-04-13 23:23:56 +01:00
grantbirki
54f29598ff npm update all the things 2023-04-13 23:17:15 +01:00
grantbirki
adb13af2ed add coverage badge to readme 2023-04-13 23:13:38 +01:00
grantbirki
68c51d2103 write coverage badge 2023-04-13 23:12:57 +01:00
grantbirki
c21c0b1aa2 enforce 100% test coverage 2023-04-13 23:11:46 +01:00
grantbirki
f28358b33b update ci-test and jest 2023-04-13 23:10:02 +01:00
grantbirki
f5eb43ca84 update readme 2023-04-13 23:08:45 +01:00
grantbirki
ddc80bafdb add a CONTRIBUTING file 2023-04-13 23:01:41 +01:00
grantbirki
f1d846dabc move test file 2023-04-13 22:59:58 +01:00
grantbirki
174365715e init the coverage badge 2023-04-13 22:58:09 +01:00
grantbirki
215f5a3008 update all workflow files to use the .node-version file in the root of the repo 2023-04-13 22:57:59 +01:00
grantbirki
ff86b6ce87 update version in package file 2023-04-13 22:57:36 +01:00
grantbirki
79773139e9 add new root level files 2023-04-13 22:57:24 +01:00
grantbirki
aaa3e0131c remove duplicate CODEOWNERS file 2023-04-13 22:51:51 +01:00
James M. Greene
f81ad71d2e Merge pull request #150 from actions/dependabot/npm_and_yarn/prettier-2.8.7
Bump prettier from 2.8.6 to 2.8.7
2023-03-31 22:15:26 -05:00
dependabot[bot]
adbdac1229 Bump prettier from 2.8.6 to 2.8.7
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.6 to 2.8.7.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.6...2.8.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-01 03:12:58 +00:00
James M. Greene
c124166064 Merge pull request #149 from actions/dependabot/npm_and_yarn/eslint-plugin-github-4.7.0
Bump eslint-plugin-github from 4.6.1 to 4.7.0
2023-03-31 22:11:04 -05:00
dependabot[bot]
d4e8b127fc Bump eslint-plugin-github from 4.6.1 to 4.7.0
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.6.1 to 4.7.0.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.6.1...v4.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-27 19:03:30 +00:00
James M. Greene
777703e175 Merge pull request #147 from actions/dependabot/npm_and_yarn/prettier-2.8.6
Bump prettier from 2.8.4 to 2.8.6
2023-03-22 15:55:56 -05:00
dependabot[bot]
34029d15d3 Bump prettier from 2.8.4 to 2.8.6
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.4 to 2.8.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.4...2.8.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 20:55:16 +00:00
James M. Greene
4cc630477b Merge pull request #142 from actions/dependabot/npm_and_yarn/eslint-config-prettier-8.8.0
Bump eslint-config-prettier from 8.7.0 to 8.8.0
2023-03-22 15:53:52 -05:00
dependabot[bot]
9f07c73fa5 Bump eslint-config-prettier from 8.7.0 to 8.8.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.7.0 to 8.8.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.7.0...v8.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 20:53:15 +00:00
James M. Greene
6ff0b5a17e Merge pull request #103 from actions/dependabot/npm_and_yarn/vercel/ncc-0.36.1
Bump @vercel/ncc from 0.31.1 to 0.36.1
2023-03-22 15:33:21 -05:00
github-actions[bot]
703ddcc7b8 Update distributables after Dependabot 🤖 2023-03-21 03:47:19 +00:00
dependabot[bot]
ca55b66fad Bump @vercel/ncc from 0.31.1 to 0.36.1
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.31.1 to 0.36.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.31.1...0.36.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-21 03:46:47 +00:00
James M. Greene
73e62e6511 Merge pull request #140 from actions/cut-v2
Update the deployment API endpoints used by the api-client module
2023-03-17 11:59:36 -05:00
Jess Bees
b254707f5c Update the deployment API endpoints used by the api-client module 2023-03-17 11:54:20 -05:00
James M. Greene
dcda0bb2bc Merge pull request #139 from actions/revert-api-shift
Revert shifted Deployments API endpoint usage
2023-03-17 11:48:46 -05:00
James M. Greene
7ed610198d Update distributables with correct dependencies 2023-03-17 11:21:12 -05:00
James M. Greene
30c6e00b35 Revert shifted API usage from https://github.com/actions/deploy-pages/pull/136
Fixes https://github.com/actions/deploy-pages/issues/137
2023-03-17 11:18:26 -05:00
Jess Bees
7fec4b245d Merge pull request #136 from actions/update-api-routes
Update the deployment API endpoints used by the api-client module
2023-03-16 09:46:32 -04:00
Jess Bees
73594fd4fc Update the deployment API endpoints used by the api-client module 2023-03-15 16:01:03 -04:00
James M. Greene
e690f03220 Merge pull request #133 from actions/dependabot/npm_and_yarn/eslint-8.36.0
Bump eslint from 8.35.0 to 8.36.0
2023-03-14 20:35:28 -05:00
dependabot[bot]
c3f52457f2 Bump eslint from 8.35.0 to 8.36.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.35.0 to 8.36.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.35.0...v8.36.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 01:34:39 +00:00
James M. Greene
72f6a10043 Merge pull request #134 from actions/dependabot/npm_and_yarn/actions/http-client-2.1.0
Bump @actions/http-client from 2.0.1 to 2.1.0
2023-03-14 20:33:58 -05:00
github-actions[bot]
c9063b9615 Update distributables after Dependabot 🤖 2023-03-13 19:12:38 +00:00
dependabot[bot]
6e7778e824 Bump @actions/http-client from 2.0.1 to 2.1.0
Bumps [@actions/http-client](https://github.com/actions/toolkit/tree/HEAD/packages/http-client) from 2.0.1 to 2.1.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/http-client/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/http-client)

---
updated-dependencies:
- dependency-name: "@actions/http-client"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 19:12:02 +00:00
James M. Greene
497da40f52 Merge pull request #124 from actions/actions-http-client
Use the `@actions/http-client` and `@actions/github` modules for proxy support
2023-03-09 14:33:48 -06:00
James M. Greene
ce35ecd745 Update distributables 2023-03-09 08:23:32 -06:00
James M. Greene
a8d1a4cdd2 Prefer elevated RequestError#status, if present 2023-03-09 08:23:21 -06:00
James M. Greene
44b836afed Update distributables 2023-03-09 08:20:38 -06:00
James M. Greene
7e85efa568 Remove redundant safe navigation operators 2023-03-09 08:20:32 -06:00
James M. Greene
df61277554 Update distributables 2023-03-09 08:19:24 -06:00
James M. Greene
f824564d16 Make sure we received a deployment response before setting deploymentInfo 2023-03-09 08:19:19 -06:00
James M. Greene
02bdb05bdf Update distributables 2023-03-09 07:50:01 -06:00
James M. Greene
360f95f104 Extract response processing logic from Artifact Exchange method 2023-03-09 07:49:50 -06:00
James M. Greene
7ee7a04145 Update distributables 2023-03-08 19:43:19 -06:00
James M. Greene
54e5e8c886 Update error handling for artifact exchange 2023-03-08 19:43:11 -06:00
James M. Greene
8ca11f25a3 Add some packages for error management 2023-03-08 19:41:20 -06:00
James M. Greene
4c1957985f Merge branch 'main' into actions-http-client 2023-03-07 22:52:29 -06:00
James M. Greene
3adc03ee17 Update job name of formatting workflow 2023-03-07 22:51:23 -06:00
James M. Greene
64868855a8 Update job name of linting workflow 2023-03-07 22:51:05 -06:00
James M. Greene
405a1ea745 Merge pull request #131 from actions/dist-check-rename
Improve name of distributables checking workflow
2023-03-07 22:50:27 -06:00
James M. Greene
4e8b484add Improve name of distributables checking workflow 2023-03-07 22:48:28 -06:00
James M. Greene
ce8433f767 Merge pull request #130 from actions/dependabot/npm_and_yarn/eslint-config-prettier-8.7.0
Bump eslint-config-prettier from 8.6.0 to 8.7.0
2023-03-07 22:46:52 -06:00
dependabot[bot]
44cd7be663 Bump eslint-config-prettier from 8.6.0 to 8.7.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.6.0 to 8.7.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.6.0...v8.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-08 04:45:12 +00:00
James M. Greene
a7b43fb46d Merge pull request #129 from actions/dependabot/npm_and_yarn/jest-29.5.0
Bump jest from 29.4.3 to 29.5.0
2023-03-07 22:44:30 -06:00
James M. Greene
f2ea9e954b Merge branch 'main' into actions-http-client 2023-03-06 22:14:47 -06:00
James M. Greene
973ee9bf72 Update distributables 2023-03-06 22:14:25 -06:00
James M. Greene
b4ef3c2b4b Add test for cancellation 2023-03-06 22:12:58 -06:00
James M. Greene
b88aa87bba Consolidate before functions 2023-03-06 22:09:40 -06:00
James M. Greene
93872af9c4 Update test with module wrapper 2023-03-06 22:08:01 -06:00
James M. Greene
6f75b9951c Lots of test updates 2023-03-06 22:04:25 -06:00
James M. Greene
452af0a0c2 Update distributables 2023-03-06 22:04:14 -06:00
James M. Greene
c981f59b6f Tweak verbosity levels 2023-03-06 22:03:56 -06:00
dependabot[bot]
e013d9f49d Bump jest from 29.4.3 to 29.5.0
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.4.3 to 29.5.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.5.0/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 19:07:32 +00:00
James M. Greene
c8c985cff1 Defer looking up RUNTIME_URL until JIT 2023-03-05 14:36:05 -06:00
James M. Greene
1947635a3f Update distributables 2023-03-03 15:44:01 -06:00
James M. Greene
f3ccae1b04 Update status handling function for Octokit request 2023-03-03 15:43:35 -06:00
James M. Greene
a2b8e8c9db Merge pull request #127 from actions/dependabot/npm_and_yarn/eslint-8.35.0
Bump eslint from 8.34.0 to 8.35.0
2023-03-03 14:15:40 -06:00
dependabot[bot]
800d4ba350 Bump eslint from 8.34.0 to 8.35.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.34.0 to 8.35.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.34.0...v8.35.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-03 20:14:56 +00:00
James M. Greene
5f0a0ff0b4 Merge pull request #126 from actions/dep-rebuild-wf
Revise Dependabot rebuild workflow
2023-03-03 14:14:11 -06:00
James M. Greene
70116d1421 Merge branch 'main' into dep-rebuild-wf 2023-03-03 14:13:38 -06:00
James M. Greene
90e90be05e Merge pull request #125 from actions/deprecate-conclusion-param
Deprecate the `conclusion` parameter for the Action
2023-03-03 14:12:42 -06:00
James M. Greene
479102aa60 Merge branch 'main' into deprecate-conclusion-param 2023-03-03 14:11:59 -06:00
James M. Greene
e47a74ee39 Update distributables 2023-02-23 20:18:56 -06:00
James M. Greene
36aae3e29a Update Octokit usage to use request.js for deployment creation 2023-02-23 20:18:48 -06:00
James M. Greene
07cfc07e56 Merge pull request #123 from actions/dependabot/npm_and_yarn/prettier-2.8.4
Bump prettier from 2.8.3 to 2.8.4
2023-02-23 01:04:47 -06:00
dependabot[bot]
e39f45b976 Bump prettier from 2.8.3 to 2.8.4
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.3 to 2.8.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.3...2.8.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-23 07:03:56 +00:00
James M. Greene
09d8b68bd9 Merge pull request #122 from actions/dependabot/npm_and_yarn/jest-29.4.3
Bump jest from 29.4.1 to 29.4.3
2023-02-23 01:03:20 -06:00
dependabot[bot]
58d3ea9333 Bump jest from 29.4.1 to 29.4.3
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.4.1 to 29.4.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.4.3/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-23 07:02:44 +00:00
James M. Greene
c33bfc33f9 Merge pull request #121 from actions/dependabot/npm_and_yarn/eslint-8.34.0
Bump eslint from 8.33.0 to 8.34.0
2023-02-23 01:02:02 -06:00
dependabot[bot]
cb8a04dd0e Bump eslint from 8.33.0 to 8.34.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.34.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.33.0...v8.34.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-23 07:00:34 +00:00
James M. Greene
4d06ee6166 Update Deployment class methods to enforce presence of this.deploymentInfo 2023-02-22 14:11:03 -06:00
James M. Greene
2864cb64c0 Merge pull request #119 from actions/fix-release-drafter
Separate use of Release Drafter
2023-02-22 11:51:53 -06:00
James M. Greene
d6aec1031d Restrict test workflow permissions to reading contents only 2023-02-22 11:51:01 -06:00
James M. Greene
155a7a7d81 Revise Dependabot rebuild workflow 2023-02-22 11:47:31 -06:00
James M. Greene
b93f1293af Deprecate the conclusion parameter for the Action 2023-02-22 08:37:21 -06:00
James M. Greene
cb00670952 Update distributables 2023-02-22 08:28:54 -06:00
James M. Greene
65f1527542 Fix bad references, run the formatter 2023-02-22 08:26:42 -06:00
James M. Greene
594fd8fbbf Remove axios reference from code 2023-02-22 08:24:49 -06:00
James M. Greene
29db692e2d JS polishing 2023-02-22 08:23:39 -06:00
James M. Greene
f577a41201 Swap out the Pages Deployment canceling interaction for the wrapped one from api-client 2023-02-22 08:23:03 -06:00
James M. Greene
a0faa043a9 Swap out the Pages Deployment status check interaction for the wrapped one from api-client 2023-02-22 08:22:23 -06:00
James M. Greene
12b8ec3b9b Move setting 'page_url' output variable to top-level index 2023-02-22 08:18:54 -06:00
James M. Greene
e7873ec09d Swap out the Pages Deployment creation interaction for the wrapped one from api-client
Also remove requestedDeployment field in favor of deploymentInfo.pending
2023-02-22 08:15:23 -06:00
James M. Greene
c2918206ce Swap out the Artifact Exchange interaction for the wrapped one from api-client 2023-02-22 08:05:32 -06:00
James M. Greene
20fe504b3b Clarify references to Action ID and Workflow Run ID in logging 2023-02-22 08:01:01 -06:00
James M. Greene
93c1fe6967 Add a module to wrap GitHub REST API and Actions Runtime API requests
Critical benefit of doing this is inheriting the proxy-honoring behavior from the @actions/http-client and @actions/github libraries
2023-02-22 07:55:03 -06:00
James M. Greene
f215e05bdc Remove dangling release drafter step from test workflow 2023-02-16 13:11:24 -06:00
James M. Greene
2fe84ca11a Add new dedicated workflow for updating draft releases 2023-02-16 13:10:55 -06:00
James M. Greene
a7cb42fc67 Switch dependencies 2023-02-16 13:09:46 -06:00
James M. Greene
ff669327f7 Merge pull request #113 from actions/dependabot/npm_and_yarn/axios-1.3.3
Bump axios from 1.3.0 to 1.3.3
2023-02-15 12:22:57 -06:00
github-actions[bot]
b7a3d169e8 Update distributables after Dependabot 🤖 2023-02-15 18:20:48 +00:00
dependabot[bot]
0c677bf5dd Bump axios from 1.3.0 to 1.3.3
Bumps [axios](https://github.com/axios/axios) from 1.3.0 to 1.3.3.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.3.0...v1.3.3)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 18:20:21 +00:00
James M. Greene
4014f178cc Merge pull request #116 from actions/dependabot/npm_and_yarn/eslint-plugin-github-4.6.1
Bump eslint-plugin-github from 4.3.4 to 4.6.1
2023-02-14 15:03:16 -06:00
dependabot[bot]
1bdd0138c1 Bump eslint-plugin-github from 4.3.4 to 4.6.1
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.3.4 to 4.6.1.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.3.4...v4.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-14 20:15:15 +00:00
James M. Greene
024ce73336 Merge pull request #115 from actions/pat-instead-of-github-token
Update rebuilding workflow to utilize an org-owned PAT
2023-02-14 12:23:13 -06:00
James M. Greene
899d42d10e Update rebuilding workflow to utilize an org-owned PAT 2023-02-14 12:19:50 -06:00
James M. Greene
0a94f060a9 Merge pull request #104 from actions/dependabot/npm_and_yarn/nock-13.3.0
Bump nock from 13.2.0 to 13.3.0
2023-02-14 00:15:28 -06:00
James M. Greene
da1c9ce783 Merge branch 'main' into dependabot/npm_and_yarn/nock-13.3.0 2023-02-14 00:14:55 -06:00
James M. Greene
dfb0b0286e Merge pull request #110 from actions/JamesMGreene-patch-1
Add a workflow to rebuild the distributables for Dependabot PRs
2023-02-13 19:51:10 -06:00
James M. Greene
802083045a Merge branch 'main' into JamesMGreene-patch-1 2023-02-13 19:49:00 -06:00
James M. Greene
f0b70b47de Merge pull request #109 from actions/dont-check-pre
Remove check for `pre/` distributables
2023-02-13 19:48:35 -06:00
James M. Greene
ec96bc5017 Just run Prettier to fix indentation nonsense 2023-02-10 23:11:30 -06:00
James M. Greene
953889442f Spacing again!? 2023-02-10 23:09:20 -06:00
James M. Greene
423b8fadd3 Fix wacky indentation from GitHub UI editor 2023-02-10 23:08:32 -06:00
James M. Greene
51ec3f54b3 Add a workflow to rebuild the distributables for Dependabot PRs 2023-02-10 23:03:00 -06:00
James M. Greene
5acfbbfe53 Remove check for pre/ distributables 2023-02-10 22:56:02 -06:00
dependabot[bot]
8199da9054 Bump nock from 13.2.0 to 13.3.0
Bumps [nock](https://github.com/nock/nock) from 13.2.0 to 13.3.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nock/nock/compare/v13.2.0...v13.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 18:12:55 +00:00
James M. Greene
51b5f463c8 Merge pull request #101 from actions/npm-cached-test
Update npm cache usage in test workflow
2023-02-01 00:34:11 -06:00
James M. Greene
a47774e76f Update npm cache usage in test workflow 2023-02-01 00:32:04 -06:00
James M. Greene
0243b6c10d Merge pull request #96 from actions/dependabot/npm_and_yarn/axios-1.3.0
Bump axios from 0.24.0 to 1.3.0
2023-02-01 00:26:17 -06:00
James M. Greene
c5b13e825e Update distributables 2023-02-01 00:24:23 -06:00
dependabot[bot]
18445d282d Bump axios from 0.24.0 to 1.3.0
Bumps [axios](https://github.com/axios/axios) from 0.24.0 to 1.3.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.24.0...v1.3.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 06:14:11 +00:00
James M. Greene
fdc3607aa5 Merge pull request #99 from actions/dependabot/npm_and_yarn/eslint-config-prettier-8.6.0
Bump eslint-config-prettier from 8.3.0 to 8.6.0
2023-02-01 00:07:31 -06:00
dependabot[bot]
f1b9a1c464 Bump eslint-config-prettier from 8.3.0 to 8.6.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.3.0 to 8.6.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.3.0...v8.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 06:05:52 +00:00
James M. Greene
90f24e5afb Merge pull request #100 from actions/dependabot/npm_and_yarn/eslint-8.33.0
Bump eslint from 8.2.0 to 8.33.0
2023-02-01 00:04:50 -06:00
dependabot[bot]
193cec853a Bump eslint from 8.2.0 to 8.33.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.2.0 to 8.33.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.2.0...v8.33.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 06:04:03 +00:00
James M. Greene
13e4944607 Merge pull request #97 from actions/dependabot/npm_and_yarn/prettier-2.8.3
Bump prettier from 2.4.1 to 2.8.3
2023-02-01 00:03:27 -06:00
dependabot[bot]
f7e8fc9988 Bump prettier from 2.4.1 to 2.8.3
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.8.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.1...2.8.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 06:02:07 +00:00
James M. Greene
2029fc10d5 Merge pull request #98 from actions/dependabot/npm_and_yarn/jest-29.4.1
Bump jest from 27.3.1 to 29.4.1
2023-02-01 00:01:07 -06:00
dependabot[bot]
ecaf0351ef Bump jest from 27.3.1 to 29.4.1
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 27.3.1 to 29.4.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.4.1/packages/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 05:56:54 +00:00
James M. Greene
97522131dc Merge pull request #95 from actions/dependabot-npm-updates
Add npm to Dependabot update list
2023-01-31 23:56:02 -06:00
James M. Greene
1ae2543781 Merge branch 'main' into dependabot-npm-updates 2023-01-31 23:55:26 -06:00
James M. Greene
b32eea76f2 Merge pull request #89 from actions/dependabot/npm_and_yarn/json5-1.0.2
Bump json5 from 1.0.1 to 1.0.2
2023-01-30 22:24:14 -06:00
dependabot[bot]
8ff204cadf Bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 04:21:50 +00:00
James M. Greene
e2e88ddce2 Merge pull request #91 from actions/dependabot/github_actions/actions/publish-action-0.2.2
Bump actions/publish-action from 0.2.1 to 0.2.2
2023-01-30 22:20:33 -06:00
dependabot[bot]
d6a56fd842 Bump actions/publish-action from 0.2.1 to 0.2.2
Bumps [actions/publish-action](https://github.com/actions/publish-action) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/actions/publish-action/releases)
- [Commits](https://github.com/actions/publish-action/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: actions/publish-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-31 04:19:48 +00:00
Yoann Chaudet
96a902c151 Merge pull request #93 from jongwooo/chore/use-cache-in-check-dist
chore: Use cache in check-dist.yml
2023-01-30 20:17:22 -08:00
James M. Greene
006c281682 Add npm to Dependabot update list 2023-01-30 22:15:03 -06:00
Jongwoo Han
0b20a897a9 chore: Use cache in check-dist.yml
Signed-off-by: jongwooo <jongwooo.han@gmail.com>
2023-01-24 00:56:41 +09:00
James M. Greene
ad08c0c36d Merge pull request #90 from actions/dependabot-config
Add Dependabot config for Actions usage updates
2023-01-13 16:37:27 -06:00
James M. Greene
22d02a6726 Comply with Prettier expectations 2023-01-13 16:34:58 -06:00
James M. Greene
8a6bc55a7a Add Dependabot config for Actions usage updates 2023-01-13 15:58:45 -06:00
James M. Greene
368bf1aa22 Merge pull request #83 from actions/pr82
Update to PR #82
2022-11-30 10:46:59 -06:00
James M. Greene
7fe67672d7 Update distributables 2022-11-30 10:43:09 -06:00
James M. Greene
cecb121fe2 Merge branch 'main' into patch-1 2022-11-30 10:33:09 -06:00
Shengyu Zhang
d67909bb68 Use correct permission name
See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
2022-12-01 00:21:00 +08:00
James M. Greene
67198a6ece Merge pull request #80 from actions/JamesMGreene-patch-1
Update to latest `actions/publish-action`
2022-11-22 22:26:39 -06:00
James M. Greene
e19278d945 Update to latest actions/publish-action
To avoid Actions core deprecation messages.

https://github.com/actions/publish-action/releases/tag/v0.2.1
2022-11-22 10:26:12 -06:00
James M. Greene
20a4baa109 Merge pull request #79 from actions/add-settings-url-to-error
Add repo settings URL to help users react to error message
2022-11-21 09:51:21 -06:00
James M. Greene
3ffff52a9c Add repo settings URL to help users react to error message 2022-11-17 12:40:28 -06:00
James M. Greene
af875e2038 Merge pull request #78 from actions/dependabot/npm_and_yarn/minimatch-3.1.2
Bump minimatch from 3.0.4 to 3.1.2
2022-11-16 20:12:48 -06:00
dependabot[bot]
2ca5e08d58 Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-17 02:08:59 +00:00
James M. Greene
9b6b97b3c8 Merge pull request #77 from actions/fix-artifact
Fix artifact name defaulting behavior
2022-11-16 20:07:55 -06:00
James M. Greene
9b641caa4a Fix artifact name defaulting behavior 2022-11-16 20:02:14 -06:00
Yoann Chaudet
a9645ed88d Merge pull request #74 from actions/bump-actions
Bump actions
2022-11-16 13:08:35 -08:00
Yoann Chaudet
fa8a0ed4a7 Merge branch 'main' into bump-actions 2022-11-16 13:05:29 -08:00
Jess Bees
d23af7369b Merge pull request #75 from actions/remove-telemetry-feature
Deprecate 'emit_telemetry' and remove its feature
2022-11-07 10:33:40 -05:00
Jess Bees
dd5e0e9d1c Deprecate 'emit_telemetry' and remove its feature
Since we emit telemetry in a different way, we can remove this feature
from the action and prevent unintentional misuse.
2022-11-04 12:19:31 -04:00
Yoann Chaudet
5bc2a71d98 Bump actions: 2022-10-31 16:32:36 -07:00
Mingzi
69a62cdfa4 Merge pull request #69 from actions/rentziass/update-actions-core
Update @actions/core to 1.10.0
2022-10-06 09:56:15 -07:00
Francesco Renzi
3cb40c9234 Update @actions/core to 1.10.0 2022-10-06 11:24:24 +01:00
James M. Greene
75c1124b14 Merge pull request #67 from actions/release-process-updates
Update release process in README
2022-09-26 15:45:28 -05:00
James M. Greene
766cde6ce5 Merge branch 'main' into release-process-updates 2022-09-26 15:43:11 -05:00
James M. Greene
1352fce070 Merge pull request #65 from actions/unused-deps
Clean up some unused dependencies
2022-09-26 15:37:52 -05:00
James M. Greene
12ecc67b1a Remove unnecessary Jest config 2022-09-26 15:30:15 -05:00
James M. Greene
b388ef8bf2 Remove unnecessary first-party use of Regenerator 2022-09-26 14:47:48 -05:00
James M. Greene
818dc836a0 Merge branch 'main' into unused-deps 2022-09-26 14:34:08 -05:00
James M. Greene
60e36109df Merge pull request #64 from actions/eslint-roller
Update ESLint config and expand usage
2022-09-26 14:12:25 -05:00
James M. Greene
7098b54017 Merge branch 'main' into eslint-roller 2022-09-26 14:10:15 -05:00
James M. Greene
539d415250 Merge pull request #63 from actions/i-feel-prettier
Expand Prettier usage
2022-09-26 14:08:33 -05:00
James M. Greene
af51f9ed91 Update release process in README 2022-09-19 10:53:48 -05:00
James M. Greene
6e7a81b68f Revise linter Actions workflow 2022-09-16 23:16:38 -05:00
James M. Greene
6bbc94d747 Remove unused deps related to Babel 2022-09-16 23:14:27 -05:00
James M. Greene
20ece23417 Remove unused packages 2022-09-16 23:10:54 -05:00
James M. Greene
503d9f28e7 Remove redundant require for global variables 2022-09-16 23:05:43 -05:00
James M. Greene
f8491fe25c Enhance ESLint configuration 2022-09-16 22:59:17 -05:00
James M. Greene
de75c272ff Expand ESLint usage and add check script 2022-09-16 22:52:58 -05:00
James M. Greene
5e811dcf4c Sort scripts alphabetically 2022-09-16 22:52:36 -05:00
James M. Greene
f14d75a58d Reformat all the things 2022-09-16 22:39:00 -05:00
James M. Greene
2727d0f5db Reorder dependencies alphabetically 2022-09-16 22:37:54 -05:00
James M. Greene
67de43d94c Remove unused dependency 2022-09-16 22:37:33 -05:00
James M. Greene
1996917397 Expand Prettier coverage 2022-09-16 22:36:35 -05:00
Jess Bees
44d4246912 Merge pull request #62 from actions/pages/get-build-conclusion
Add optional 'conclusion' argument to emitTelemetry
2022-09-16 09:33:36 -04:00
Jess Bees
5de668770e Gotta update npm deps to accurately compile it 2022-09-15 13:05:09 -04:00
Jess Bees
1c52af2b34 Add optional 'conclusion' argument to emitTelemetry
If present, will include the value of `conclusion` with the telemetry
POST body (gh/gh needs a separate PR to recognize this)
2022-09-15 12:14:23 -04:00
James M. Greene
c2379ec5e7 Merge pull request #61 from actions/upstream-preview-alpha
Add support for preview deployments internal alpha experiment 🧪
2022-09-13 19:58:43 -05:00
James M. Greene
e7d22decca Remove internal debugging from @actions/core 2022-09-09 18:54:00 -05:00
James M. Greene
9b78820d58 Update distributables 2022-09-09 18:51:52 -05:00
James M. Greene
dd23652c5c Adhere to Prettier formatting 2022-09-09 18:51:35 -05:00
James M. Greene
ec456f786c Correct outdated reference 2022-09-09 18:50:08 -05:00
James M. Greene
b68f047ef0 Merge branch 'main' into upstream-preview-alpha 2022-09-09 18:49:17 -05:00
James M. Greene
791c72a9c0 Merge pull request #60 from actions/yaml-consistency
Use single quotes in Action metadata for consistency
2022-09-09 18:48:39 -05:00
James M. Greene
b45768bc0f Merge branch 'main' into yaml-consistency 2022-09-09 18:47:11 -05:00
James M. Greene
3c12eff351 Merge pull request #59 from actions/fix-org-refs
Correct organization references
2022-09-09 18:46:55 -05:00
James M. Greene
f5fafd81c2 Remove '.only' from the new unit test 2022-09-09 18:46:36 -05:00
James M. Greene
f8578825e2 Update distributables 2022-09-09 18:44:20 -05:00
James M. Greene
d2d7f752d5 Add support for preview deployments 2022-09-09 18:44:03 -05:00
James M. Greene
ad109d8dbd Add failing test 2022-09-09 18:29:17 -05:00
James M. Greene
3ed1d6d9a8 Use single quotes in Action metadata for consistency 2022-09-09 17:09:19 -05:00
James M. Greene
71efac92ad Add 'preview' input parameter to Action metadata 2022-09-09 17:08:16 -05:00
James M. Greene
b742641b90 Correct organization references 2022-09-09 16:59:57 -05:00
Yoann Chaudet
e4de7aa8e4 Merge pull request #57 from actions/release-instructions
Add release instructions
2022-08-24 11:24:11 -07:00
Yoann Chaudet
84346747a3 v1 2022-08-24 10:55:10 -07:00
Yoann Chaudet
9113cc7efc fix lint 2022-08-24 10:54:29 -07:00
Yoann Chaudet
858592354e Add release instructions 2022-08-24 10:53:23 -07:00
Yoann Chaudet
114f9cc1f8 Merge pull request #56 from actions/cancel
Explicitly handle cancellation on errors
2022-08-24 10:46:21 -07:00
Yoann Chaudet
0dfe0f0668 Merge pull request #55 from actions/formatter
Bring back the formatter
2022-08-24 08:59:01 -07:00
Yoann Chaudet
c7c77bb21c Explicitly handle cancellation on errors 2022-08-23 21:32:40 -07:00
Yoann Chaudet
369d1aed92 Add linter 2022-08-23 17:28:44 -07:00
Yoann Chaudet
4865e84b02 Bring back the formatter 2022-08-23 17:19:21 -07:00
James M. Greene
b627026553 Merge pull request #54 from actions/codeowners-file
Add CODEOWNERS file
2022-08-19 13:29:24 -05:00
James M. Greene
9bd912c0ca Add CODEOWNERS file 2022-08-19 13:28:07 -05:00
James M. Greene
ed034ea1c3 Merge pull request #53 from actions/consistent-release-workflow
Make the major version release workflow consistent with other Actions
2022-08-19 13:27:01 -05:00
James M. Greene
8f9a38d5e7 Update major version only for full releases 2022-08-19 12:33:44 -05:00
James M. Greene
71b1669225 Make the major version release workflow consistent with other Actions
Based on https://github.com/paper-spa/configure-pages/edit/main/.github/workflows/release.yml
2022-08-19 12:26:27 -05:00
James M. Greene
a87638c69c Merge pull request #52 from actions/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.6.0 to 1.9.1
2022-08-19 12:16:59 -05:00
James M. Greene
85d735dc73 Update distributables 2022-08-19 12:14:36 -05:00
dependabot[bot]
2e87ed0ac6 Bump @actions/core from 1.6.0 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.6.0 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-18 19:49:21 +00:00
James M. Greene
e490850a64 Lowercase the README title 2022-08-10 14:01:18 -05:00
James M. Greene
5743579482 Merge pull request #49 from actions/marketplace-unique-name
Update Action name to enable Marketplace publishing
2022-08-10 14:00:26 -05:00
James M. Greene
5fd268dcdd Update name per suggestion 2022-08-10 12:59:11 -05:00
James M. Greene
fbb46fa661 Update Action name for Marketplace publishing 2022-08-09 22:15:35 -05:00
Mingzi
eaaccf9fc5 Merge pull request #46 from actions/bug-fixing
Fix hardcoded api endpoint and artifact name lookup
2022-08-04 18:06:53 -07:00
yimysty
8daa1e0ead add syntax sugar back 2022-08-04 17:11:26 -07:00
yimysty
99f9079292 roll into right node syntax 2022-08-04 17:09:46 -07:00
yimysty
06d025f427 update node test version 2022-08-04 17:05:51 -07:00
yimysty
7f629c4ce0 apply the syntax 2022-08-04 17:04:26 -07:00
yimysty
35e615a00c check if it's due to "." 2022-08-04 16:56:13 -07:00
yimysty
462df77e16 add more log to debug 2022-08-04 16:52:07 -07:00
yimysty
9ebae0d26b try print error message 2022-08-04 16:25:55 -07:00
yimysty
d0b379e44d move artifact url out of context 2022-08-04 16:23:15 -07:00
yimysty
225abf7840 increase test timeout 2022-08-04 16:13:28 -07:00
yimysty
1f0422c0df add some debug log? 2022-08-04 16:07:20 -07:00
yimysty
85b0d1617e moke get artifact name 2022-08-04 16:02:46 -07:00
yimysty
3e976523d7 adjust pages hard code endpoint + fix artifact look up 2022-08-04 15:43:58 -07:00
Yoann Chaudet
38e42fe573 Merge pull request #42 from actions/more-doc
Update README to document a few things
2022-07-27 13:33:20 -07:00
Yoann Chaudet
44ea2ec0c1 Fix titles 2022-07-26 11:16:01 -07:00
Yoann Chaudet
b4e423ab11 Update README.md
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
2022-07-26 11:14:52 -07:00
Yoann Chaudet
58b7d54130 Update README.md
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
2022-07-26 11:14:35 -07:00
Yoann Chaudet
974e2a6ded Update README.md
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
2022-07-26 11:11:30 -07:00
Yoann Chaudet
f5d172a561 Update README.md
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
2022-07-26 11:11:16 -07:00
Yoann Chaudet
33bba0fd45 Update README.md
Co-authored-by: Tommy Byrd <tcbyrd@github.com>
2022-07-26 11:10:56 -07:00
Yoann Chaudet
1f18c7a3ba Document default too 2022-07-26 11:09:31 -07:00
Yoann Chaudet
86843fdbb5 Update README to document a few things 2022-07-26 10:47:31 -07:00
Mingzi
4d0af465be Merge pull request #41 from DarkC35/patch-1
Fix compare URL in Release
2022-07-05 14:44:51 -07:00
DarkC
bea9114e88 fix compare url in release 2022-07-05 12:24:09 +02:00
Mingzi
41f0a8ab89 Merge pull request #40 from actions/improve-error-message
Improve error message
2022-06-29 10:37:48 -07:00
yimysty
b918908973 run npm generate file 2022-06-29 10:35:08 -07:00
Mingzi
1ae5d2452b Update src/deployment.js
Co-authored-by: Yoann Chaudet <yoannchaudet@github.com>
2022-06-29 10:16:32 -07:00
yimysty
e2219a89b1 fix broken test cases 2022-06-28 18:18:42 -07:00
yimysty
72b116b825 fix unintended changes 2022-06-28 18:01:48 -07:00
yimysty
11a13019c2 adjust debugging message 2022-06-28 17:58:10 -07:00
yimysty
801d74db09 switch to console.log 2022-06-28 17:55:21 -07:00
yimysty
64c69a5fdf normalize error message 2022-06-28 17:50:08 -07:00
yimysty
03d70e4a19 info stack trace 2022-06-28 17:44:21 -07:00
yimysty
64e33b2a0d info stack trace 2022-06-28 17:39:10 -07:00
yimysty
c3d24faf75 info stack trace 2022-06-28 17:38:14 -07:00
yimysty
2b0c6eaf67 try output stacktrace as well 2022-06-28 17:35:03 -07:00
yimysty
358b034ef8 improve error message 2022-06-28 16:08:07 -07:00
Yoann Chaudet
13ef0cb0a0 Merge pull request #39 from actions/joshmgross/add-codeowners
Add CODEOWNERS
2022-06-14 13:30:16 -07:00
Josh Gross
2bf05927ae Add CODEOWNERS 2022-06-14 14:39:58 -04:00
Mingzi
0745e9700c Merge pull request #38 from actions/fix-cancell-token
Fix cancel deployment token is empty
2022-06-08 14:19:14 -07:00
yimysty
43dced9e8c add pack-lock.json 2022-06-08 12:57:34 -07:00
yimysty
fce105b3ea fix unable to cancel deployment due to cancel token nil 2022-06-08 11:47:06 -07:00
Yoann Chaudet
148e2ea9dd Create codeql-analysis.yml 2022-04-26 10:29:56 -07:00
Yoann Chaudet
506f839b97 Merge pull request #31 from fulldecent/patch-1
Correct documentation for reporting interval
2022-04-26 10:26:02 -07:00
Yoann Chaudet
f7a158aceb Merge branch 'main' into patch-1 2022-04-26 10:24:40 -07:00
Yoann Chaudet
ca23c7917e Merge pull request #29 from actions/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-04-26 10:24:21 -07:00
dependabot[bot]
0c60998bd5 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 17:21:30 +00:00
Yoann Chaudet
4154a47b87 Merge pull request #34 from actions/dependabot/npm_and_yarn/follow-redirects-1.14.9
Bump follow-redirects from 1.14.4 to 1.14.9
2022-04-26 10:20:47 -07:00
Yoann Chaudet
17fd28439d ci 2022-04-26 10:19:37 -07:00
Yoann Chaudet
0f19a8f78c Update dist 2022-04-26 09:58:05 -07:00
dependabot[bot]
595c840e2a Bump follow-redirects from 1.14.4 to 1.14.9
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.4 to 1.14.9.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.4...v1.14.9)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 16:55:09 +00:00
Mingzi
57f2f8bd29 Merge pull request #32 from fulldecent/patch-2
correct spelling of GitHub
2022-04-15 11:21:39 -07:00
Mingzi
68c14dcd2c Merge branch 'main' into patch-2 2022-04-15 11:20:55 -07:00
Jess Bees
a7af90c328 Merge pull request #30 from actions/decouple-telemetry
Remove the support for older dynamic jekyll workflows
2022-04-15 13:51:54 -04:00
William Entriken
ef910bd895 correct spelling of GitHub 2022-04-11 14:30:09 -04:00
William Entriken
53f4e898cd Correct documentation for reporting interval 2022-04-11 14:29:33 -04:00
Jess Bees
62c650c70d Remove the support for older dynamic jekyll workflows
The pages dynamic workflow now decouples telemetry from deploy for 100%
of users, so we can remove this old conditional.
2022-04-04 16:12:36 -04:00
Jess Bees
eaf36f48c9 Merge pull request #24 from actions/decouple-telemetry
Decouple telemetry API call from main action
2022-03-31 12:34:24 -04:00
Jess Bees
01f6ae5af2 Recompile action after pulling in PR suggestions 2022-03-31 12:05:36 -04:00
Jess Bees
82cb77089c Update action.yml
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2022-03-31 11:47:49 -04:00
Jess Bees
ad36b7023a Don't bother converting action input to string
This has been an established pattern with Actions for a long time; we don't have to worry about it changing.

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2022-03-31 11:47:33 -04:00
Jess Bees
32b8b86ff0 Support existing behavior of this action 2022-03-29 15:08:35 -04:00
Jess Bees
a598b2af14 Correctly test for boolean input's truthiness
It gets cast to a string! Eep!
2022-03-29 09:45:18 -04:00
Jess Bees
f511fa4665 Merge branch 'main' into decouple-telemetry 2022-03-29 09:05:35 -04:00
Yoann Chaudet
0e157789db Merge pull request #27 from actions/increase-default-query-interval
Increase default query interval and fix time exceed bug
2022-03-28 12:38:22 -07:00
yimysty
12940a5b99 fix the timeout not honor bug 2022-03-28 12:32:59 -07:00
yimysty
6afc4f2884 slow query seconds 2022-03-28 12:28:46 -07:00
Jess Bees
7a1dc4e394 update dist files 2022-03-23 14:56:28 -04:00
Jess Bees
92f6725bee Only emit telemetry when the emit_telemetry input is truthy 2022-03-23 14:40:57 -04:00
Jess Bees
e1279a88ef Don't call the telemetry pre-hook entrypoint 2022-03-23 14:22:16 -04:00
45 changed files with 156220 additions and 22812 deletions

View File

@@ -1,2 +0,0 @@
node_modules/
dist/

View File

@@ -1,19 +1,17 @@
{ {
"env": { "env": {
"commonjs": true, "commonjs": true,
"es6": true, "es2021": true,
"jest": true, "node": true,
"node": true "jest": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
}, },
"plugins": ["github"],
"extends": ["eslint:recommended", "prettier", "plugin:github/internal"],
"parserOptions": { "parserOptions": {
"ecmaVersion": 2018 "ecmaVersion": 12
}, },
"rules": { "rules": {
"semi": ["error", "never"] "semi": ["error", "never"]
} },
} "ignorePatterns": ["/dist/"]
}

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
dist/** -diff linguist-generated=true

2
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,2 @@
# Default PR reviewers
* @actions/pages

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'

View File

@@ -3,8 +3,14 @@ name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION' tag-template: 'v$RESOLVED_VERSION'
template: | template: |
# Changelog # Changelog
$CHANGES $CHANGES
See details of [all code changes](https://github.com/actions/jekyll-build-pages/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
---
See details of [all code changes](https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release.
:warning: For use with products other than GitHub.com, such as GitHub Enterprise Server, please consult the [compatibility table](https://github.com/$OWNER/$REPOSITORY/#compatibilty).
categories: categories:
- title: '🚀 Features' - title: '🚀 Features'
labels: labels:

View File

@@ -3,7 +3,7 @@
# `index.js` is the code that will run. # `index.js` is the code that will run.
# For our project, we generate this file using `ncc` # For our project, we generate this file using `ncc`
# We need to make sure the checked-in `index.js` actually matches what we expect it to be. # We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/ name: Check distributables
on: on:
push: push:
@@ -21,12 +21,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout
uses: actions/checkout@v4
- name: Set Node.js 16.x - name: Setup Node.JS
uses: actions/setup-node@v1 uses: actions/setup-node@v4
with: with:
node-version: 16.x node-version-file: '.node-version'
cache: npm
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
@@ -35,10 +37,17 @@ jobs:
run: npm run prepare run: npm run prepare
- name: Compare the expected and actual dist/ directories - name: Compare the expected and actual dist/ directories
id: diff
run: | run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:" echo "Detected uncommitted changes after build in dist folder. See status below:"
git diff git diff
exit 1 exit 1
fi fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/

34
.github/workflows/check-formatting.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Check formatting
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: npm
- name: Install dependencies
run: npm ci
- name: Verify formatting
run: npm run format:check

34
.github/workflows/check-linter.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Check linting
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: npm
- name: Install dependencies
run: npm ci
- name: Verify linter
run: npm run lint:check

70
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: CodeQL
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '40 0 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
steps:
- name: Checkout
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

16
.github/workflows/draft-release.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Draft release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@09c613e259eb8d4e7c81c2cb00618eb5fc4575a7 # v5.25.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,51 @@
name: Rebuild distributables for Dependabot PRs
on:
push:
branches:
- 'dependabot/npm**'
# No permissions needed for `GITHUB_TOKEN` since we're using a PAT instead
permissions: {}
jobs:
rebuild-dist:
if: ${{ github.event.sender.login == 'dependabot[bot]' }}
# This allows a subsequently queued workflow run to interrupt previous runs.
# It is evaluated AFTER the job's `if` condition, so a push triggered by this
# workflow's PAT will NOT interrupt a run triggered by a push from Dependabot.
concurrency:
group: '${{ github.workflow }} / ${{ github.job }} @ ${{ github.ref }}'
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAGES_AUTOMATION_PAT }}
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: npm
- name: Install dependencies
run: npm ci
- name: Rebuild the dist/ directory
run: npm run prepare
- name: Commit any differences present in the dist/ directory
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after rebuild in dist folder. Committing..."
git add dist/
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Update distributables after Dependabot 🤖"
echo "Pushing branch ${{ github.ref_name }}"
git push origin ${{ github.ref_name }}
fi

View File

@@ -1,7 +1,7 @@
name: Release new action version name: Release
on: on:
release: release:
types: [edited] types: [released]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
TAG_NAME: TAG_NAME:
@@ -10,19 +10,21 @@ on:
env: env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions: permissions:
contents: write contents: write
jobs: jobs:
update_tag: update_tag:
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
name: releaseNewActionVersion
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
# Note: this environment is protected
name: Release
steps: steps:
- name: Update the ${{ env.TAG_NAME }} tag - name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag id: update-major-tag
uses: actions/publish-action@v0.1.0 uses: actions/publish-action@v0.2.2
with: with:
source-tag: ${{ env.TAG_NAME }} source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }} slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -1,28 +1,29 @@
name: Run Tests name: Run tests
on: on:
push: push:
branches: branches:
- main - main
pull_request: pull_request:
permissions:
contents: read
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Set Node.JS - name: Setup Node.JS
uses: actions/setup-node@v2 uses: actions/setup-node@v4
with: with:
node-version: 12.x node-version-file: '.node-version'
cache: npm
- name: Install dependencies - name: Install dependencies
run: npm install run: npm ci
- name: Run tests
run: npm run test - name: Run tests
# Drafts your next Release notes as Pull Requests are merged into "main" run: npm run test
- uses: release-drafter/release-drafter@v5
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
.gitignore vendored
View File

@@ -64,4 +64,4 @@ typings/
.env .env
# next.js build output # next.js build output
.next .next

1
.node-version Normal file
View File

@@ -0,0 +1 @@
20.10.0

View File

@@ -1 +1,6 @@
node_modules/ # Ignore build artifacts
/dist/
/pre/
# Ignore all Markdown files
*.md

View File

@@ -1,10 +0,0 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid"
}

10
.prettierrc.yml Normal file
View File

@@ -0,0 +1,10 @@
# Prettier (formatter) configuration
---
printWidth: 120
tabWidth: 2
useTabs: false
semi: false
singleQuote: true
trailingComma: none
bracketSpacing: true
arrowParens: avoid

29
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,29 @@
# Contributing 💻
All contributions are welcome and greatly appreciated!
## Steps to Contribute 💡
> Check the `.node-version` file in the root of this repo so see what version of Node.js is required for local development - note, this can be different from the version of Node.js which runs the Action on GitHub runners. It is suggested to download [nodenv](https://github.com/nodenv/nodenv) which uses this file and manages your Node.js versions for you
1. Fork this repository
2. Make your changes
3. [Test](#testing-) your changes locally
4. Before opening a pull request, please run `npm run all` to verify formatting, linting, tests, generated files, etc.
5. Commit and push your changes to your fork
6. Open a pull request back to this repository
7. Wait for an approval or changes requested from the maintainers of this repository
After merging the pull request, the maintainers of this repository will create a new release with those changes included. After that, everyone can utilize the newly integrated changes in their own Actions workflows and enjoy your awesome improvements!
## Testing 🧪
### Running the test suite (required)
Simply run the following command to execute the entire test suite:
```bash
npm test
```
> Note: This requires that you have already run `npm install`.

126
README.md
View File

@@ -1,17 +1,127 @@
# Deploy-Pages # deploy-pages 🚀
This deploys artifacts to GitHub Pages. [![Release](https://img.shields.io/github/v/release/actions/deploy-pages?label=Release&logo=github)](https://github.com/actions/deploy-pages/releases/latest) [![Linting](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/check-linter.yml?label=Linting&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/check-linter.yml) [![Formatting](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/check-formatting.yml?label=Formatting&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/check-formatting.yml) [![Tests](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/test.yml?label=Tests&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/test.yml) ![Coverage](./coverage_badge.svg) [![Distributables](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/check-dist.yml?label=Distributables&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/check-dist.yml) [![CodeQL](https://img.shields.io/github/actions/workflow/status/actions/deploy-pages/codeql-analysis.yml?label=CodeQL&logo=github)](https://github.com/actions/deploy-pages/actions/workflows/codeql-analysis.yml)
# Scope This action is used to deploy [Actions artifacts][artifacts] to [GitHub Pages](https://pages.github.com/).
⚠️ Official support for building Pages with Actions is in public beta at the moment. The scope is currently limited to **public repositories only**. ## Usage
# Usage See [action.yml](action.yml) for the various `inputs` this action supports (or [below](#inputs-📥)).
See [action.yml](action.yml) For examples that make use of this action, check out our [starter-workflows][starter-workflows] in a variety of frameworks.
<!-- TODO: document custom workflow --> This action deploys a Pages site previously uploaded as an artifact (e.g. using [`actions/upload-pages-artifact`][upload-pages-artifact]).
# License We recommend this action to be used in a dedicated job:
```yaml
jobs:
# Build job
build:
# <Not provided for brevity>
# At a minimum this job should upload artifacts using actions/upload-pages-artifact
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
```
### Inputs 📥
| Input | Required? | Default | Description |
| ----- | --------- | ------- | ----------- |
| `token` | `true` | `${{ github.token }}` | The GitHub token used to create an authenticated client - Provided for you by default! |
| `timeout` | `false` | `"600000"` | Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes) |
| `error_count` | `false` | `"10"` | Maximum number of status report errors before cancelling a deployment (default: 10) |
| `reporting_interval` | `false` | `"5000"` | Time in milliseconds between two deployment status reports (default: 5 seconds) |
| `artifact_name` | `false` | `"github-pages"` | The name of the artifact to deploy |
| `preview` | `false` | `"false"` | Is this attempting to deploy a pull request as a GitHub Pages preview site? (NOTE: This feature is only in alpha currently and is not available to the public!) |
### Outputs 📤
| Output | Description |
| ------ | ----------- |
| `page_url` | The URL of the deployed Pages site |
### Environment Variables 🌎
| Variable | Description |
| -------- | ----------- |
| `GITHUB_PAGES` | This environment variable is created and set to the string value `"true"` so that framework build tools may choose to differentiate their output based on the intended target hosting platform. |
## Security Considerations
There are a few important considerations to be aware of:
1. The artifact being deployed must have been uploaded in a previous step, either in the same job or a separate job that doesn't execute until the upload is complete. See [`actions/upload-pages-artifact`][upload-pages-artifact] for more information about the format of the artifact we expect.
2. The job that executes the deployment must at minimum have the following permissions:
- `pages: write`
- `id-token: write`
3. The deployment should target the `github-pages` environment (you may use a different environment name if needed, but this is not recommended.)
4. If your Pages site is using a source branch, the deployment must originate from this source branch unless [your environment is protected][environment-protection] in which case the environment protection rules take precedence over the source branch rule
5. If your Pages site is using GitHub Actions as the source, while not required we highly recommend you also [protect your environment][environment-protection] (we will configure it by default for you).
## Compatibility
This action is primarily designed for use with GitHub.com's Actions workflows and Pages deployments. However, certain releases should also be compatible with GitHub Enterprise Server (GHES) `3.7` and above.
| Release | GHES Compatibility |
|:---|:---|
| [`v4`](https://github.com/actions/deploy-pages/releases/tag/v4) | :warning: Incompatible at this time |
| [`v3`](https://github.com/actions/deploy-pages/releases/tag/v3) | `>= 3.9` |
| `v3.x.x` | `>= 3.9` |
| [`v2`](https://github.com/actions/deploy-pages/releases/tag/v2) | `>= 3.9` |
| `v2.x.x` | `>= 3.9` |
| [`v1`](https://github.com/actions/deploy-pages/releases/tag/v1) | `>= 3.7` |
| [`v1.2.8`](https://github.com/actions/deploy-pages/releases/tag/v1.2.8) | `>= 3.7` |
| [`v1.2.7`](https://github.com/actions/deploy-pages/releases/tag/v1.2.7) | :warning: `>= 3.9` [Incompatible with prior versions!](https://github.com/actions/deploy-pages/issues/137) |
| [`v1.2.6`](https://github.com/actions/deploy-pages/releases/tag/v1.2.6) | `>= 3.7` |
| `v1.x.x` | `>= 3.7` |
## Release Instructions
In order to release a new version of this Action:
1. Locate the semantic version of the [upcoming release][release-list] (a draft is maintained by the [`draft-release` workflow][draft-release]).
2. Publish the draft release from the `main` branch with semantic version as the tag name, _with_ the checkbox to publish to the GitHub Marketplace checked. :ballot_box_with_check:
3. After publishing the release, the [`release` workflow][release] will automatically run to create/update the corresponding major version tag such as `v1`.
⚠️ Environment approval is required. Check the [Release workflow run list][release-workflow-runs].
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE). The scripts and documentation in this project are released under the [MIT License](LICENSE).
<!-- references -->
[starter-workflows]: https://github.com/actions/starter-workflows/tree/main/pages
[upload-pages-artifact]: https://github.com/actions/upload-pages-artifact
[artifacts]: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
[environment-protection]: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-protection-rules
[release-list]: https://github.com/actions/deploy-pages/releases
[draft-release]: .github/workflows/draft-release.yml
[release]: .github/workflows/release.yml
[release-workflow-runs]: https://github.com/actions/deploy-pages/actions/workflows/release.yml

View File

@@ -1,9 +1,9 @@
name: 'Deploy to GitHub Pages' name: 'Deploy GitHub Pages site'
description: 'A GitHub Action to deploy an artifact to GitHub Pages' description: 'A GitHub Action to deploy an artifact as a GitHub Pages site'
author: 'GitHub'
runs: runs:
using: 'node16' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'
pre: 'pre/index.js'
inputs: inputs:
token: token:
description: 'GitHub token' description: 'GitHub token'
@@ -12,15 +12,23 @@ inputs:
timeout: timeout:
description: 'Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes)' description: 'Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes)'
required: false required: false
default: "600000" default: '600000'
error_count: error_count:
description: 'Maximum number of status report errors before cancelling a deployment (default: 10)' description: 'Maximum number of status report errors before cancelling a deployment (default: 10)'
required: false required: false
default: "10" default: '10'
reporting_interval: reporting_interval:
description: 'Time in milliseconds between two deployment status report (default: 1 second)' description: 'Time in milliseconds between two deployment status report (default: 5 seconds)'
required: false required: false
default: "1000" default: '5000'
artifact_name:
description: 'Name of the artifact to deploy'
required: false
default: 'github-pages'
preview:
description: 'Is this attempting to deploy a pull request as a GitHub Pages preview site? (NOTE: This feature is only in alpha currently and is not available to the public!)'
required: false
default: 'false'
outputs: outputs:
page_url: page_url:
description: 'URL to deployed Github Pages' description: 'URL to deployed GitHub Pages'

View File

@@ -1 +0,0 @@
module.exports = {presets: ['@babel/preset-env']}

1
coverage_badge.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20" role="img" aria-label="Coverage: 81.13%"><title>Coverage: 81.13%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="53" height="20" fill="#dfb317"/><rect width="116" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">81.13%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">81.13%</text></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

152601
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

3247
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load Diff

2
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +0,0 @@
module.exports = {
transform: {
'^.+\\.(js|jsx)$': 'babel-jest'
}
}

12782
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +1,39 @@
{ {
"name": "deploy-pages", "name": "deploy-pages",
"version": "0.0.1", "version": "0.0.0",
"description": "Deploy an actions artifact to GitHub Pages", "description": "Deploy an actions artifact to GitHub Pages",
"main": "./dist/index.js", "main": "./dist/index.js",
"dependencies": { "dependencies": {
"@actions/artifact": "^0.5.2", "@actions/artifact": "^2.0.0",
"@actions/core": "^1.6.0", "@actions/core": "^1.10.1",
"@babel/plugin-transform-runtime": "^7.16.0", "@actions/github": "^6.0.0",
"axios": "^0.24.0", "@octokit/request-error": "^5.0.1",
"regenerator-runtime": "^0.13.9", "http-status-messages": "^1.1.0"
"axios-retry": "^3.2.4",
"tar": "^6.1.11"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.16.0", "@vercel/ncc": "^0.38.1",
"@github/prettier-config": "0.0.4", "eslint": "^8.55.0",
"@vercel/ncc": "^0.31.1", "eslint-config-prettier": "^9.1.0",
"eslint": "^8.2.0", "eslint-plugin-github": "^4.10.1",
"eslint-config-prettier": "^8.3.0", "jest": "^29.7.0",
"eslint-plugin-github": "^4.3.4", "make-coverage-badge": "^1.2.0",
"jest": "^27.3.1", "nock": "^13.4.0",
"nock": "^13.2.0", "prettier": "^3.1.0",
"prettier": "^2.4.1" "undici": "^6.0.0"
}, },
"scripts": { "scripts": {
"lint": "eslint src", "all": "npm run format && npm run lint && npm run prepare && npm run test && npm run coverage-badge",
"prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt && ncc build src/pre.js -o pre --source-map --license licenses.txt", "coverage-badge": "make-coverage-badge --output-path ./coverage_badge.svg",
"test": "jest", "format": "prettier --write .",
"all": "npm run lint && npm run prepare && npm run test" "format:check": "prettier --check .",
"lint": "DEBUG=eslint:cli-engine eslint --fix .",
"lint:check": "DEBUG=eslint:cli-engine eslint .",
"prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt",
"test": "jest"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/paper-spa/deploy-pages.git" "url": "git+https://github.com/actions/deploy-pages.git"
}, },
"keywords": [ "keywords": [
"GitHub", "GitHub",
@@ -40,7 +42,24 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/paper-spa/deploy-pages/issues" "url": "https://github.com/actions/deploy-pages/issues"
}, },
"homepage": "https://github.com/paper-spa/deploy-pages#readme" "homepage": "https://github.com/actions/deploy-pages#readme",
"jest": {
"coverageReporters": [
"json-summary",
"text",
"lcov"
],
"collectCoverage": true,
"collectCoverageFrom": [
"./src/**"
],
"coverageThreshold": {
"global": {
"lines": 70,
"statements": 70
}
}
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,260 +0,0 @@
@actions/core
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@babel/runtime
MIT
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
axios
MIT
Copyright (c) 2014-present Matt Zabriskie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
axios-retry
Apache-2.0
Copyright 2019 Softonic International S.A.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
debug
MIT
(The MIT License)
Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
follow-redirects
MIT
Copyright 2014present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
has-flag
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
is-retry-allowed
MIT
MIT License
Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ms
MIT
The MIT License (MIT)
Copyright (c) 2016 Zeit, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
regenerator-runtime
MIT
MIT License
Copyright (c) 2014-present, Facebook, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
supports-color
MIT
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
const process = require('process')
const cp = require('child_process')
const path = require('path')
describe('with all environment variables set', () => {
beforeEach(() => {
process.env.GITHUB_RUN_ID = '123'
process.env.GITHUB_REPOSITORY = 'actions/is-awesome'
process.env.GITHUB_TOKEN = 'gha-token'
process.env.GITHUB_SHA = '123abc'
process.env.GITHUB_ACTOR = 'monalisa'
process.env.GITHUB_ACTION = '__monalisa/octocat'
process.env.GITHUB_ACTION_PATH = 'something'
})
it('executes cleanly', done => {
const ip = path.join(__dirname, '../index.js')
cp.exec(`node ${ip}`, { env: process.env }, (err, stdout) => {
expect(stdout).toMatch(/::debug::all variables are set/)
done()
})
})
})
describe('with variables missing', () => {
it('execution fails if there are missing variables', done => {
delete process.env.GITHUB_RUN_ID
const ip = path.join(__dirname, '../index.js')
cp.exec(`node ${ip}`, { env: process.env }, (err, stdout) => {
expect(stdout).toBe('')
expect(err).toBeTruthy()
expect(err.code).toBe(1)
done()
})
})
})

File diff suppressed because it is too large Load Diff

View File

@@ -1,156 +0,0 @@
require('regenerator-runtime/runtime')
const core = require('@actions/core')
const axios = require('axios')
// All variables we need from the runtime are loaded here
const getContext = require('./context')
const errorStatus = {
'unknown_status' : 'Unable to get deployment status.',
'not_found' : 'Deployment not found.',
'deployment_attempt_error' : 'Deployment temporarily failed, a retry will be automatically scheduled...'
}
class Deployment {
constructor() {
const context = getContext()
this.runTimeUrl = context.runTimeUrl
this.repositoryNwo = context.repositoryNwo
this.runTimeToken = context.runTimeToken
this.buildVersion = context.buildVersion
this.buildActor = context.buildActor
this.actionsId = context.workflowRun
this.githubToken = context.githubToken
this.workflowRun = context.workflowRun
this.requestedDeployment = false
this.deploymentInfo = null
}
// Ask the runtime for the unsigned artifact URL and deploy to GitHub Pages
// by creating a deployment with that artifact
async create(idToken) {
try {
core.info(`Actor: ${this.buildActor}`)
core.info(`Action ID: ${this.actionsId}`)
const pagesDeployEndpoint = `https://api.github.com/repos/${this.repositoryNwo}/pages/deployment`
const artifactExgUrl = `${this.runTimeUrl}_apis/pipelines/workflows/${this.workflowRun}/artifacts?api-version=6.0-preview`
core.info(`Artifact URL: ${artifactExgUrl}`)
const {data} = await axios.get(artifactExgUrl, {
headers: {
Authorization: `Bearer ${this.runTimeToken}`,
'Content-Type': 'application/json'
}
})
core.info(JSON.stringify(data))
if (data.value.length == 0) {
throw new Error('No uploaded artifact was found! Please check if there are any errors at build step.')
}
const artifactUrl = `${data.value[0].url}&%24expand=SignedContent`
const payload = {
artifact_url: artifactUrl,
pages_build_version: this.buildVersion,
oidc_token: idToken
}
core.info(`Creating deployment with payload:\n${JSON.stringify(payload, null, '\t')}`)
const response = await axios.post(pagesDeployEndpoint, payload, {
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${this.githubToken}`,
'Content-type': 'application/json'
}
})
this.requestedDeployment = true
core.info(`Created deployment for ${this.buildVersion}`)
core.info(JSON.stringify(response.data))
this.deploymentInfo = response.data
} catch (error) {
core.info(`Failed to create deployment for ${this.buildVersion}.`)
if (error.response && error.response.data) {
core.info(JSON.stringify(error.response.data))
}
core.setFailed(error)
throw error
}
}
// Poll the deployment endpoint for status
async check() {
try {
const statusUrl = this.deploymentInfo != null ?
this.deploymentInfo["status_url"] :
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
const timeout = Number(core.getInput('timeout'))
const reportingInterval = Number(core.getInput('reporting_interval'))
const maxErrorCount = Number(core.getInput('error_count'))
var startTime = Date.now()
var errorCount = 0
// Time in milliseconds between two deployment status report when status errored, default 0.
var errorReportingInterval = 0
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
while (true) {
// Handle reporting interval
await new Promise(r => setTimeout(r, reportingInterval + errorReportingInterval))
// Check status
var res = await axios.get(statusUrl, {
headers: {
Authorization: `token ${this.githubToken}`
}
})
if (res.data.status == 'succeed') {
core.info('Reported success!')
core.setOutput('status', 'succeed')
break
} else if (res.data.status == 'deployment_failed') {
// Fall into permanent error, it may be caused by ongoing incident or malicious deployment content or exhausted automatic retry times.
core.setFailed('Deployment failed, try again later.')
break
} else if(res.data.status == 'deployment_content_failed') {
// The uploaded artifact is invalid.
core.setFailed('Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.')
break
} else if (errorStatus[res.data.status]) {
// A temporary error happened, will query the status again
core.info(errorStatus[res.data.status])
} else {
core.info('Current status: ' + res.data.status)
}
if (res.status != 200 || !!errorStatus[res.data.status]) {
errorCount++
// set the Maximum error reporting interval greater than 15 sec but below 30 sec.
if (errorReportingInterval < 1000 * 15) {
errorReportingInterval = errorReportingInterval << 1 | 1
}
} else {
// reset the error reporting interval once get the proper status back.
errorReportingInterval = 0
}
if (errorCount >= maxErrorCount) {
core.info('Too many errors, aborting!')
core.setFailed('Failed with status code: ' + res.status)
break
}
}
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
}
} catch (error) {
core.setFailed(error)
if (error.response && error.response.data) {
core.info(JSON.stringify(error.response.data))
}
}
}
}
module.exports = {Deployment}

View File

@@ -1,46 +1,42 @@
require('regenerator-runtime/runtime')
// This package assumes a site has already been built and the files exist in the current workspace // This package assumes a site has already been built and the files exist in the current workspace
// If there's an artifact named `artifact.tar`, it can upload that to actions on its own, // If there's an artifact named `artifact.tar`, it can upload that to actions on its own,
// without the user having to do the tar process themselves. // without the user having to do the tar process themselves.
const core = require('@actions/core') const core = require('@actions/core')
// const github = require('@actions/github'); // TODO: Not used until we publish API endpoint to the @action/github package
const axios = require('axios')
const {Deployment} = require('./deployment') const { Deployment } = require('./internal/deployment')
const getContext = require('./internal/context')
const deployment = new Deployment() const deployment = new Deployment()
// TODO: If the artifact hasn't been created, we can create it and upload to artifact storage ourselves
// const tar = require('tar')
async function cancelHandler(evtOrExitCodeOrError) { async function cancelHandler(evtOrExitCodeOrError) {
try { await deployment.cancel()
if (deployment.requestedDeployment) {
const pagesCancelDeployEndpoint = `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/cancel/${process.env.GITHUB_SHA}`
await axios.put(
pagesCancelDeployEndpoint,
{},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
'Content-type': 'application/json'
}
}
)
core.info(`Deployment cancelled with ${pagesCancelDeployEndpoint}`)
}
} catch (e) {
console.info('Deployment cancellation failed', e)
}
process.exit(isNaN(+evtOrExitCodeOrError) ? 1 : +evtOrExitCodeOrError) process.exit(isNaN(+evtOrExitCodeOrError) ? 1 : +evtOrExitCodeOrError)
} }
async function main() { async function main() {
const { isPreview } = getContext()
let idToken = ''
try { try {
const idToken = await core.getIDToken() idToken = await core.getIDToken()
await deployment.create(idToken) } catch (error) {
console.log(error)
core.setFailed(`Ensure GITHUB_TOKEN has permission "id-token: write".`)
return
}
try {
const deploymentInfo = await deployment.create(idToken)
// Output the deployed Pages URL
let pageUrl = deploymentInfo?.['page_url'] || ''
const previewUrl = deploymentInfo?.['preview_url'] || ''
if (isPreview && previewUrl) {
pageUrl = previewUrl
}
core.setOutput('page_url', pageUrl)
await deployment.check() await deployment.check()
} catch (error) { } catch (error) {
core.setFailed(error) core.setFailed(error)
@@ -52,4 +48,4 @@ process.on('SIGINT', cancelHandler)
process.on('SIGTERM', cancelHandler) process.on('SIGTERM', cancelHandler)
// Main // Main
main().then(() => require('./pre')) main()

View File

@@ -1,221 +0,0 @@
const core = require('@actions/core')
const process = require('process')
const cp = require('child_process')
const path = require('path')
const nock = require('nock')
const axios = require('axios')
const { expect, jest } = require('@jest/globals')
const {Deployment} = require('./deployment')
describe('with all environment variables set', () => {
beforeEach(() => {
process.env.ACTIONS_RUNTIME_URL = 'my-url'
process.env.GITHUB_RUN_ID = '123'
process.env.ACTIONS_RUNTIME_TOKEN = 'a-token'
process.env.GITHUB_REPOSITORY = 'paper-spa/is-awesome'
process.env.GITHUB_TOKEN = 'gha-token'
process.env.GITHUB_SHA = '123abc'
process.env.GITHUB_ACTOR = 'monalisa'
process.env.GITHUB_ACTION = '__monalisa/octocat'
process.env.GITHUB_ACTION_PATH = 'something'
})
it('Executes cleanly', done => {
const ip = path.join(__dirname, './index.js')
cp.exec(`node ${ip}`, { env: process.env }, (err, stdout) => {
expect(stdout).toMatch(/::debug::all variables are set/)
done()
})
})
})
describe('with variables missing', () => {
it('execution fails if there are missing variables', done => {
delete process.env.ACTIONS_RUNTIME_URL
const ip = path.join(__dirname, './index.js')
cp.exec(`node ${ip}`, {env: process.env}, (err, stdout) => {
expect(stdout).toBe("")
expect(err).toBeTruthy()
expect(err.code).toBe(1)
done()
})
})
})
describe('create', () => {
beforeAll(() => {
process.env.ACTIONS_RUNTIME_URL = 'http://my-url/'
process.env.GITHUB_RUN_ID = '123'
process.env.ACTIONS_RUNTIME_TOKEN = 'a-token'
process.env.GITHUB_REPOSITORY = 'paper-spa/is-awesome'
process.env.GITHUB_TOKEN = 'gha-token'
process.env.GITHUB_SHA = '123abc'
process.env.GITHUB_ACTOR = 'monalisa'
process.env.GITHUB_ACTION = '__monalisa/octocat'
process.env.GITHUB_ACTION_PATH = 'something'
jest.spyOn(core, 'setOutput').mockImplementation(param => {
return param
})
jest.spyOn(core, 'setFailed').mockImplementation(param => {
return param
})
// Mock error/warning/info/debug
jest.spyOn(core, 'error').mockImplementation(jest.fn())
jest.spyOn(core, 'warning').mockImplementation(jest.fn())
jest.spyOn(core, 'info').mockImplementation(jest.fn())
jest.spyOn(core, 'debug').mockImplementation(jest.fn())
})
it('can successfully create a deployment', async () => {
process.env.GITHUB_SHA = 'valid-build-version'
const fakeJwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNjllMWIxOC1jOGFiLTRhZGQtOGYxOC03MzVlMzVjZGJhZjAiLCJzdWIiOiJyZXBvOnBhcGVyLXNwYS9taW55aTplbnZpcm9ubWVudDpQcm9kdWN0aW9uIiwiYXVkIjoiaHR0cHM6Ly9naXRodWIuY29tL3BhcGVyLXNwYSIsInJlZiI6InJlZnMvaGVhZHMvbWFpbiIsInNoYSI6ImEyODU1MWJmODdiZDk3NTFiMzdiMmM0YjM3M2MxZjU3NjFmYWM2MjYiLCJyZXBvc2l0b3J5IjoicGFwZXItc3BhL21pbnlpIiwicmVwb3NpdG9yeV9vd25lciI6InBhcGVyLXNwYSIsInJ1bl9pZCI6IjE1NDY0NTkzNjQiLCJydW5fbnVtYmVyIjoiMzQiLCJydW5fYXR0ZW1wdCI6IjIiLCJhY3RvciI6IllpTXlzdHkiLCJ3b3JrZmxvdyI6IkNJIiwiaGVhZF9yZWYiOiIiLCJiYXNlX3JlZiI6IiIsImV2ZW50X25hbWUiOiJwdXNoIiwicmVmX3R5cGUiOiJicmFuY2giLCJlbnZpcm9ubWVudCI6IlByb2R1Y3Rpb24iLCJqb2Jfd29ya2Zsb3dfcmVmIjoicGFwZXItc3BhL21pbnlpLy5naXRodWIvd29ya2Zsb3dzL2JsYW5rLnltbEByZWZzL2hlYWRzL21haW4iLCJpc3MiOiJodHRwczovL3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwibmJmIjoxNjM4ODI4MDI4LCJleHAiOjE2Mzg4Mjg5MjgsImlhdCI6MTYzODgyODYyOH0.1wyupfxu1HGoTyIqatYg0hIxy2-0bMO-yVlmLSMuu2w'
const scope = nock(`http://my-url`)
.get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview')
.reply(200, { value: [{ url: 'https://fake-artifact.com' }] })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
axios.post = jest.fn().mockResolvedValue('test')
// Create the deployment
const deployment = new Deployment()
await deployment.create(fakeJwt)
expect(axios.post).toBeCalledWith(
'https://api.github.com/repos/paper-spa/is-awesome/pages/deployment',
{
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
pages_build_version: 'valid-build-version',
oidc_token: fakeJwt
},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: 'Bearer ',
'Content-type': 'application/json'
}
}
)
expect(core.setFailed).not.toHaveBeenCalled()
expect(core.info).toHaveBeenCalledWith(
'Created deployment for valid-build-version'
)
scope.done()
})
it('Reports errors with failed deployments', async () => {
process.env.GITHUB_SHA = 'invalid-build-version'
const scope = nock(`http://my-url`)
.get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview')
.reply(200, { value: [{ url: 'https://invalid-artifact.com' }] })
axios.post = jest.fn().mockRejectedValue({
status: 400
})
// Create the deployment
const deployment = new Deployment()
try {
deployment.create()
} catch (err) {
expect(axios.post).toBeCalledWith(
'https://api.github.com/repos/paper-spa/is-awesome/pages/deployment',
{
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent',
pages_build_version: 'invalid-build-version'
},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: 'Bearer ',
'Content-type': 'application/json'
}
}
)
expect(core.info).toHaveBeenLastCalledWith(
'Failed to create deployment for invalid-build-version.'
)
expect(core.setFailed).toHaveBeenCalledWith({ status: 400 })
scope.done()
}
})
})
describe('check', () => {
beforeAll(() => {
process.env.ACTIONS_RUNTIME_URL = 'http://my-url/'
process.env.GITHUB_RUN_ID = '123'
process.env.ACTIONS_RUNTIME_TOKEN = 'a-token'
process.env.GITHUB_REPOSITORY = 'paper-spa/is-awesome'
process.env.GITHUB_TOKEN = 'gha-token'
process.env.GITHUB_SHA = '123abc'
process.env.GITHUB_ACTOR = 'monalisa'
process.env.GITHUB_ACTION = '__monalisa/octocat'
process.env.GITHUB_ACTION_PATH = 'something'
jest.spyOn(core, 'setOutput').mockImplementation(param => {
return param
})
jest.spyOn(core, 'setFailed').mockImplementation(param => {
return param
})
// Mock error/warning/info/debug
jest.spyOn(core, 'error').mockImplementation(jest.fn())
jest.spyOn(core, 'warning').mockImplementation(jest.fn())
jest.spyOn(core, 'info').mockImplementation(jest.fn())
jest.spyOn(core, 'debug').mockImplementation(jest.fn())
})
it('sets output to success when deployment is successful', async () => {
process.env.GITHUB_SHA = 'valid-build-version'
let repositoryNwo = process.env.GITHUB_REPOSITORY
let buildVersion = process.env.GITHUB_SHA
// mock a successful call to create a deployment
axios.post = jest.fn().mockResolvedValue({ status: 200 })
// mock a completed deployment with status = 'succeed'
axios.get = jest.fn().mockResolvedValue({
status: 200,
data: {
status: 'succeed'
}
})
// Create the deployment
const deployment = new Deployment()
core.GetInput = jest.fn(input => {
switch (input) {
case 'timeout':
return 10 * 1000
case 'reporting_interval':
return 0
}
})
jest.spyOn(core, 'getInput')
await deployment.check()
expect(axios.get).toBeCalledWith(
`https://api.github.com/repos/${repositoryNwo}/pages/deployment/status/${buildVersion}`,
{
headers: {
Authorization: 'token '
}
}
)
expect(core.setOutput).toBeCalledWith('status', 'succeed')
expect(core.info).toHaveBeenCalledWith('Reported success!')
})
})

179
src/internal/api-client.js Normal file
View File

@@ -0,0 +1,179 @@
const core = require('@actions/core')
const github = require('@actions/github')
const { DefaultArtifactClient } = require('@actions/artifact')
const { RequestError } = require('@octokit/request-error')
const HttpStatusMessages = require('http-status-messages')
function wrapTwirpResponseLikeOctokit(twirpResponse, requestOptions) {
// Specific response shape aligned with Octokit
const response = {
url: requestOptions.url,
status: 200,
headers: {
...requestOptions.headers
},
data: twirpResponse
}
return response
}
// Mimic the errors thrown by Octokit for consistency.
function wrapTwirpErrorLikeOctokit(twirpError, requestOptions) {
const rawErrorMsg = twirpError?.message || twirpError?.toString() || ''
const statusCodeMatch = rawErrorMsg.match(/Failed request: \((?<statusCode>\d+)\)/)
const statusCode = statusCodeMatch?.groups?.statusCode ?? 500
// Try to provide the best error message
const errorMsg =
rawErrorMsg ||
// Fallback to the HTTP status message based on the status code
HttpStatusMessages[statusCode] ||
// Or if the status code is unexpected...
`Unknown error (${statusCode})`
// RequestError is an Octokit-specific class
return new RequestError(errorMsg, statusCode, {
response: {
url: requestOptions.url,
status: statusCode,
headers: {
...requestOptions.headers
},
data: rawErrorMsg ? { message: rawErrorMsg } : ''
},
request: requestOptions
})
}
function getArtifactsServiceOrigin() {
const resultsUrl = process.env.ACTIONS_RESULTS_URL
return resultsUrl ? new URL(resultsUrl).origin : ''
}
async function getArtifactMetadata({ artifactName }) {
const artifactClient = new DefaultArtifactClient()
// Primarily for debugging purposes, accuracy is not critical
const requestOptions = {
method: 'POST',
url: `${getArtifactsServiceOrigin()}/twirp/github.actions.results.api.v1.ArtifactService/ListArtifacts`,
headers: {
'content-type': 'application/json'
},
body: {}
}
try {
core.info(`Fetching artifact metadata for "${artifactName}" in this workflow run`)
let response
try {
const twirpResponse = await artifactClient.listArtifacts()
response = wrapTwirpResponseLikeOctokit(twirpResponse, requestOptions)
} catch (twirpError) {
core.error('Listing artifact metadata failed', twirpError)
const octokitError = wrapTwirpErrorLikeOctokit(twirpError, requestOptions)
throw octokitError
}
const filteredArtifacts = response.data.artifacts.filter(artifact => artifact.name === artifactName)
const artifactCount = filteredArtifacts.length
core.debug(`List artifact count: ${artifactCount}`)
if (artifactCount === 0) {
throw new Error(
`No artifacts named "${artifactName}" were found for this workflow run. Ensure artifacts are uploaded with actions/artifact@v4 or later.`
)
} else if (artifactCount > 1) {
throw new Error(
`Multiple artifacts named "${artifactName}" were unexpectedly found for this workflow run. Artifact count is ${artifactCount}.`
)
}
const artifact = filteredArtifacts[0]
core.debug(`Artifact: ${JSON.stringify(artifact)}`)
if (!artifact.size) {
core.warning('Artifact size was not found. Unable to verify if artifact size exceeds the allowed size.')
}
return artifact
} catch (error) {
core.error(
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages, or Actions? Please re-run the deployment at a later time.',
error
)
throw error
}
}
async function createPagesDeployment({ githubToken, artifactId, buildVersion, idToken, isPreview = false }) {
const octokit = github.getOctokit(githubToken)
const payload = {
artifact_id: artifactId,
pages_build_version: buildVersion,
oidc_token: idToken
}
if (isPreview === true) {
payload.preview = true
}
core.info(`Creating Pages deployment with payload:\n${JSON.stringify(payload, null, '\t')}`)
try {
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployments', {
owner: github.context.repo.owner,
repo: github.context.repo.repo,
...payload
})
return response.data
} catch (error) {
core.error('Creating Pages deployment failed', error)
throw error
}
}
async function getPagesDeploymentStatus({ githubToken, deploymentId }) {
const octokit = github.getOctokit(githubToken)
core.info('Getting Pages deployment status...')
try {
const response = await octokit.request('GET /repos/{owner}/{repo}/pages/deployments/{deploymentId}', {
owner: github.context.repo.owner,
repo: github.context.repo.repo,
deploymentId
})
return response.data
} catch (error) {
core.error('Getting Pages deployment status failed', error)
throw error
}
}
async function cancelPagesDeployment({ githubToken, deploymentId }) {
const octokit = github.getOctokit(githubToken)
core.info('Canceling Pages deployment...')
try {
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployments/{deploymentId}/cancel', {
owner: github.context.repo.owner,
repo: github.context.repo.repo,
deploymentId
})
return response.data
} catch (error) {
core.error('Canceling Pages deployment failed', error)
throw error
}
}
module.exports = {
getArtifactMetadata,
createPagesDeployment,
getPagesDeploymentStatus,
cancelPagesDeployment
}

View File

@@ -3,14 +3,16 @@ const core = require('@actions/core')
// Load variables from Actions runtime // Load variables from Actions runtime
function getRequiredVars() { function getRequiredVars() {
return { return {
runTimeUrl: process.env.ACTIONS_RUNTIME_URL,
workflowRun: process.env.GITHUB_RUN_ID, workflowRun: process.env.GITHUB_RUN_ID,
runTimeToken: process.env.ACTIONS_RUNTIME_TOKEN,
repositoryNwo: process.env.GITHUB_REPOSITORY, repositoryNwo: process.env.GITHUB_REPOSITORY,
buildVersion: process.env.GITHUB_SHA, buildVersion: process.env.GITHUB_SHA,
buildActor: process.env.GITHUB_ACTOR, buildActor: process.env.GITHUB_ACTOR,
actionsId: process.env.GITHUB_ACTION, actionsId: process.env.GITHUB_ACTION,
githubToken: core.getInput('token') githubToken: core.getInput('token'),
githubApiUrl: process.env.GITHUB_API_URL ?? 'https://api.github.com',
githubServerUrl: process.env.GITHUB_SERVER_URL ?? 'https://github.com',
artifactName: core.getInput('artifact_name') || 'github-pages',
isPreview: core.getInput('preview') === 'true'
} }
} }

243
src/internal/deployment.js Normal file
View File

@@ -0,0 +1,243 @@
const core = require('@actions/core')
// All variables we need from the runtime are loaded here
const getContext = require('./context')
const {
getArtifactMetadata,
createPagesDeployment,
getPagesDeploymentStatus,
cancelPagesDeployment
} = require('./api-client')
const temporaryErrorStatus = {
unknown_status: 'Unable to get deployment status.',
not_found: 'Deployment not found.',
deployment_attempt_error: 'Deployment temporarily failed, a retry will be automatically scheduled...'
}
const finalErrorStatus = {
deployment_failed: 'Deployment failed, try again later.',
deployment_perms_error: 'Deployment failed. Please ensure that the file permissions are correct.',
deployment_content_failed:
'Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.',
deployment_cancelled: 'Deployment cancelled.',
deployment_lost: 'Deployment failed to report final status.'
}
const MAX_TIMEOUT = 600000
const ONE_GIGABYTE = 1073741824
const SIZE_LIMIT_DESCRIPTION = '1 GB'
class Deployment {
constructor() {
const context = getContext()
this.repositoryNwo = context.repositoryNwo
this.buildVersion = context.buildVersion
this.buildActor = context.buildActor
this.actionsId = context.actionsId
this.githubToken = context.githubToken
this.workflowRun = context.workflowRun
this.deploymentInfo = null
this.githubApiUrl = context.githubApiUrl
this.githubServerUrl = context.githubServerUrl
this.artifactName = context.artifactName
this.isPreview = context.isPreview === true
this.timeout = MAX_TIMEOUT
this.startTime = null
}
// Call GitHub api to fetch artifacts matching the provided name and deploy to GitHub Pages
// by creating a deployment with that artifact id
async create(idToken) {
if (Number(core.getInput('timeout')) > MAX_TIMEOUT) {
core.warning(
`Warning: timeout value is greater than the allowed maximum - timeout set to the maximum of ${MAX_TIMEOUT} milliseconds.`
)
}
const timeoutInput = Number(core.getInput('timeout'))
this.timeout = !timeoutInput || timeoutInput <= 0 ? MAX_TIMEOUT : Math.min(timeoutInput, MAX_TIMEOUT)
try {
core.debug(`Actor: ${this.buildActor}`)
core.debug(`Action ID: ${this.actionsId}`)
core.debug(`Actions Workflow Run ID: ${this.workflowRun}`)
const artifactData = await getArtifactMetadata({ artifactName: this.artifactName })
if (artifactData?.size > ONE_GIGABYTE) {
core.warning(
`Uploaded artifact size of ${artifactData?.size} bytes exceeds the allowed size of ${SIZE_LIMIT_DESCRIPTION}. Deployment might fail.`
)
}
const deployment = await createPagesDeployment({
githubToken: this.githubToken,
artifactId: artifactData.id,
buildVersion: this.buildVersion,
idToken,
isPreview: this.isPreview
})
if (deployment) {
this.deploymentInfo = {
...deployment,
id: deployment.id || deployment.status_url?.split('/')?.pop() || this.buildVersion,
pending: true
}
this.startTime = Date.now()
}
core.info(`Created deployment for ${this.buildVersion}, ID: ${this.deploymentInfo?.id}`)
core.debug(JSON.stringify(deployment))
return deployment
} catch (error) {
core.error(error.stack)
// build customized error message based on server response
if (error.response) {
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}.`
if (error.status === 400) {
errorMessage += ` Responded with: ${error.message}`
} else if (error.status === 403) {
errorMessage += ' Ensure GITHUB_TOKEN has permission "pages: write".'
} else if (error.status === 404) {
const pagesSettingsUrl = `${this.githubServerUrl}/${this.repositoryNwo}/settings/pages`
errorMessage += ` Ensure GitHub Pages has been enabled: ${pagesSettingsUrl}`
// If using GHES, add a special note about compatibility
if (new URL(this.githubServerUrl).hostname.toLowerCase() !== 'github.com') {
errorMessage +=
'\nNote: This action version may not yet support GitHub Enterprise Server, please check the compatibility table.'
}
} else if (error.status >= 500) {
errorMessage +=
' Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.'
}
throw new Error(errorMessage)
} else {
// istanbul ignore next
throw error
}
}
}
// Poll the deployment endpoint for status
async check() {
// Don't attempt to check status if no deployment was created
if (!this.deploymentInfo) {
core.setFailed(temporaryErrorStatus.not_found)
return
}
if (this.deploymentInfo.pending !== true) {
core.setFailed(temporaryErrorStatus.unknown_status)
return
}
const deploymentId = this.deploymentInfo.id || this.buildVersion
const reportingInterval = Number(core.getInput('reporting_interval'))
const maxErrorCount = Number(core.getInput('error_count'))
let errorCount = 0
// Time in milliseconds between two deployment status report when status errored, default 0.
let errorReportingInterval = 0
let deployment = null
let errorStatus = 0
/*eslint no-constant-condition: ["error", { "checkLoops": false }]*/
while (true) {
// Handle reporting interval
await new Promise(resolve => setTimeout(resolve, reportingInterval + errorReportingInterval))
// Check status
try {
deployment = await getPagesDeploymentStatus({
githubToken: this.githubToken,
deploymentId
})
if (deployment.status === 'succeed') {
core.info('Reported success!')
core.setOutput('status', 'succeed')
this.deploymentInfo.pending = false
break
} else if (finalErrorStatus[deployment.status]) {
// Fall into permanent error, it may be caused by ongoing incident, malicious deployment content, exhausted automatic retry times, invalid artifact, etc.
core.setFailed(finalErrorStatus[deployment.status])
this.deploymentInfo.pending = false
break
} else if (temporaryErrorStatus[deployment.status]) {
// A temporary error happened, will query the status again
core.warning(temporaryErrorStatus[deployment.status])
} else {
core.info('Current status: ' + deployment.status)
}
// reset the error reporting interval once get the proper status back.
errorReportingInterval = 0
} catch (error) {
core.error(error.stack)
// build customized error message based on server response
if (error.response) {
errorStatus = error.status || error.response.status
errorCount++
// set the maximum error reporting interval greater than 15 sec but below 30 sec.
if (errorReportingInterval < 1000 * 15) {
errorReportingInterval = (errorReportingInterval << 1) | 1
}
}
}
if (errorCount >= maxErrorCount) {
core.error('Too many errors, aborting!')
core.setFailed('Failed with status code: ' + errorStatus)
// Explicitly cancel the deployment
await this.cancel()
return
}
// Handle timeout
if (Date.now() - this.startTime >= this.timeout) {
core.error('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
// Explicitly cancel the deployment
await this.cancel()
return
}
}
}
async cancel() {
// Don't attempt to cancel if no deployment was created
if (!this.deploymentInfo || this.deploymentInfo.pending !== true) {
core.debug('No deployment to cancel')
return
}
// Cancel the deployment
try {
const deploymentId = this.deploymentInfo.id || this.buildVersion
await cancelPagesDeployment({
githubToken: this.githubToken,
deploymentId
})
core.info(`Canceled deployment with ID ${deploymentId}`)
this.deploymentInfo.pending = false
} catch (error) {
core.setFailed(error)
if (error.response?.data) {
core.error(JSON.stringify(error.response.data))
}
}
}
}
module.exports = { Deployment, MAX_TIMEOUT, ONE_GIGABYTE, SIZE_LIMIT_DESCRIPTION }

View File

@@ -1,57 +0,0 @@
const core = require('@actions/core')
const axios = require('axios')
const axiosRetry = require('axios-retry')
const retryAttempt = 3
axiosRetry(axios, {
retries: retryAttempt,
retryDelay: retryCount => {
core.info(`retrying to send pages telemetry with attempt: ${retryCount}`)
return retryCount * 1000 // time interval between retries, with 1s, 2s, 3s
},
// retry on error greater than 500
retryCondition: error => {
return error.response.status >= 500
}
})
const {Deployment} = require('./deployment')
async function emitTelemetry() {
// All variables we need from the runtime are set in the Deployment constructor
const deployment = new Deployment()
const telemetryUrl = `https://api.github.com/repos/${deployment.repositoryNwo}/pages/telemetry`
core.info(`Sending telemetry for run id ${deployment.workflowRun}`)
await axios
.post(
telemetryUrl,
{github_run_id: deployment.workflowRun},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${deployment.githubToken}`,
'Content-type': 'application/json'
}
}
)
.catch(err => {
if (err.response.status !== 200) {
throw new Error(
`failed to emit metric with status code: ${err.response.status} after ${retryAttempt} retry attempts`
)
}
})
}
async function main() {
try {
await emitTelemetry()
} catch (error) {
core.error('failed to emit pages build telemetry')
}
}
main()
module.exports = {emitTelemetry}

View File

@@ -1,64 +0,0 @@
const core = require('@actions/core')
const process = require('process')
const axios = require('axios')
const {expect, jest} = require('@jest/globals')
const {emitTelemetry} = require('./pre')
describe('emitTelemetry', () => {
beforeAll(() => {
process.env.ACTIONS_RUNTIME_URL = 'my-url'
process.env.GITHUB_RUN_ID = '123'
process.env.ACTIONS_RUNTIME_TOKEN = 'a-token'
process.env.GITHUB_REPOSITORY = 'paper-spa/is-awesome'
process.env.GITHUB_TOKEN = 'gha-token'
process.env.GITHUB_SHA = '123abc'
process.env.GITHUB_ACTOR = 'monalisa'
process.env.GITHUB_ACTION = '__monalisa/octocat'
process.env.GITHUB_ACTION_PATH = 'something'
jest.spyOn(core, 'setOutput').mockImplementation(param => {
return param
})
jest.spyOn(core, 'setFailed').mockImplementation(param => {
return param
})
// Mock error/warning/info/debug
jest.spyOn(core, 'error').mockImplementation(jest.fn())
jest.spyOn(core, 'warning').mockImplementation(jest.fn())
jest.spyOn(core, 'info').mockImplementation(jest.fn())
jest.spyOn(core, 'debug').mockImplementation(jest.fn())
})
it('will send telemetry to github api', done => {
process.env.GITHUB_SHA = 'valid-build-version'
axios.post = jest.fn().mockResolvedValue({
status: 200,
data: {
status: 'succeed'
}
})
emitTelemetry()
expect(axios.post).toBeCalledWith(
'https://api.github.com/repos/paper-spa/is-awesome/pages/telemetry',
{
github_run_id: process.env.GITHUB_RUN_ID
},
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: 'Bearer ',
'Content-type': 'application/json'
}
}
)
expect(core.setFailed).not.toHaveBeenCalled()
done()
})
})