Compare commits

...

73 Commits
v2.0.3 ... v3

Author SHA1 Message Date
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
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
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
18 changed files with 51623 additions and 7664 deletions

View File

@@ -22,10 +22,10 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Node.JS - name: Setup Node.JS
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm

View File

@@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Node.JS - name: Setup Node.JS
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm

View File

@@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Node.JS - name: Setup Node.JS
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm

View File

@@ -38,7 +38,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL

View File

@@ -11,6 +11,6 @@ jobs:
draft-release: draft-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: release-drafter/release-drafter@569eb7ee3a85817ab916c8f8ff03a5bd96c9c83e # v5.23.0 - uses: release-drafter/release-drafter@09c613e259eb8d4e7c81c2cb00618eb5fc4575a7 # v5.25.0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
token: ${{ secrets.PAGES_AUTOMATION_PAT }} token: ${{ secrets.PAGES_AUTOMATION_PAT }}
- name: Setup Node.JS - name: Setup Node.JS
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm

View File

@@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Setup Node.JS - name: Setup Node.JS
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: npm cache: npm

View File

@@ -1 +1 @@
18.9.0 20.10.0

View File

@@ -41,7 +41,7 @@ jobs:
steps: steps:
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
id: deployment id: deployment
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action uses: actions/deploy-pages@v3 # or specific "vX.X.X" version tag for this action
``` ```
### Inputs 📥 ### Inputs 📥
@@ -51,7 +51,7 @@ jobs:
| `token` | `true` | `${{ github.token }}` | The GitHub token used to create an authenticated client - Provided for you by default! | | `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) | | `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) | | `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 report (default: 5 seconds) | | `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 | | `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!) | | `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!) |
@@ -67,10 +67,6 @@ jobs:
| -------- | ----------- | | -------- | ----------- |
| `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. | | `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. |
## Scope
⚠️ Official support for building Pages with Actions is in public beta at the moment.
## Security Considerations ## Security Considerations
There are a few important considerations to be aware of: There are a few important considerations to be aware of:
@@ -89,16 +85,17 @@ There are a few important considerations to be aware of:
## Compatibility ## Compatibility
This action is primarily design 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. 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 | | Release | GHES Compatibility |
|:---|:---| |:---|:---|
| [`v2`](https://github.com/actions/deploy-pages/releases/tag/v2) | 🛑 Incompatible. Anticipating compatibility with `>= 3.9`. | | [`v3`](https://github.com/actions/deploy-pages/releases/tag/v3) | `>= 3.9` |
| [`v2.0.1`](https://github.com/actions/deploy-pages/releases/tag/v2.0.1) | 🛑 Incompatible. Anticipating compatibility with `>= 3.9`. | | `v3.x.x` | `>= 3.9` |
| [`v2.0.0`](https://github.com/actions/deploy-pages/releases/tag/v2.0.0) | 🛑 Incompatible. Anticipating compatibility with `>= 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`](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.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: [Incompatible](https://github.com/actions/deploy-pages/issues/137). Anticipating compatibility with `>= 3.9`. | | [`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.2.6`](https://github.com/actions/deploy-pages/releases/tag/v1.2.6) | `>= 3.7` |
| `v1.x.x` | `>= 3.7` | | `v1.x.x` | `>= 3.7` |
@@ -110,7 +107,7 @@ In order to release a new version of this Action:
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: 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 the major version tag such as `v1`. 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]. ⚠️ Environment approval is required. Check the [Release workflow run list][release-workflow-runs].

View File

@@ -2,7 +2,7 @@ name: 'Deploy GitHub Pages site'
description: 'A GitHub Action to deploy an artifact as a GitHub Pages site' description: 'A GitHub Action to deploy an artifact as a GitHub Pages site'
author: 'GitHub' author: 'GitHub'
runs: runs:
using: 'node16' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'
inputs: inputs:
token: token:

View File

@@ -1 +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: 79.72%"><title>Coverage: 79.72%</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="#e05d44"/><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">79.72%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">79.72%</text></g></svg> <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.39%"><title>Coverage: 81.39%</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.39%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">81.39%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

53836
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

152
dist/licenses.txt generated vendored
View File

@@ -47,6 +47,28 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
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.
@octokit/auth-token @octokit/auth-token
MIT MIT
The MIT License The MIT License
@@ -219,16 +241,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
@vercel/ncc
MIT
Copyright 2018 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.
before-after-hook before-after-hook
Apache-2.0 Apache-2.0
Apache License Apache License
@@ -455,57 +467,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
http-status-messages http-status-messages
is-plain-object
MIT
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert.
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.
node-fetch
MIT
The MIT License (MIT)
Copyright (c) 2016 David Frank
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.
once once
ISC ISC
The ISC License The ISC License
@@ -525,9 +486,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tr46
MIT
tunnel tunnel
MIT MIT
The MIT License (MIT) The MIT License (MIT)
@@ -553,6 +511,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
undici
MIT
MIT License
Copyright (c) Matteo Collina and Undici 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.
universal-user-agent universal-user-agent
ISC ISC
# [ISC License](https://spdx.org/licenses/ISC) # [ISC License](https://spdx.org/licenses/ISC)
@@ -577,47 +560,6 @@ The above copyright notice and this permission notice shall be included in all c
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. 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.
webidl-conversions
BSD-2-Clause
# The BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
whatwg-url
MIT
The MIT License (MIT)
Copyright (c) 20152016 Sebastian Mayr
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.
wrappy wrappy
ISC ISC
The ISC License The ISC License

4620
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,21 +4,22 @@
"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/core": "^1.10.0", "@actions/core": "^1.10.1",
"@actions/github": "^5.1.1", "@actions/github": "^6.0.0",
"@actions/http-client": "^2.1.0", "@actions/http-client": "^2.2.0",
"@octokit/request-error": "^4.0.1", "@octokit/request-error": "^5.0.1",
"http-status-messages": "^1.1.0" "http-status-messages": "^1.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.36.1", "@vercel/ncc": "^0.38.1",
"eslint": "^8.42.0", "eslint": "^8.55.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-github": "^4.8.0", "eslint-plugin-github": "^4.10.1",
"jest": "^29.5.0", "jest": "^29.7.0",
"nock": "^13.3.1", "make-coverage-badge": "^1.2.0",
"prettier": "^2.8.8", "nock": "^13.4.0",
"make-coverage-badge": "^1.2.0" "prettier": "^3.1.0",
"undici": "^6.0.0"
}, },
"scripts": { "scripts": {
"all": "npm run format && npm run lint && npm run prepare && npm run test && npm run coverage-badge", "all": "npm run format && npm run lint && npm run prepare && npm run test && npm run coverage-badge",

View File

@@ -1,5 +1,8 @@
const core = require('@actions/core') const core = require('@actions/core')
// For mocking network calls with core http (http-client)
const nock = require('nock') const nock = require('nock')
// For mocking network calls with native Fetch (octokit)
const { MockAgent, setGlobalDispatcher } = require('undici')
const { Deployment, MAX_TIMEOUT, ONE_GIGABYTE, SIZE_LIMIT_DESCRIPTION } = require('../../internal/deployment') const { Deployment, MAX_TIMEOUT, ONE_GIGABYTE, SIZE_LIMIT_DESCRIPTION } = require('../../internal/deployment')
@@ -7,6 +10,8 @@ const fakeJwt =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNjllMWIxOC1jOGFiLTRhZGQtOGYxOC03MzVlMzVjZGJhZjAiLCJzdWIiOiJyZXBvOnBhcGVyLXNwYS9taW55aTplbnZpcm9ubWVudDpQcm9kdWN0aW9uIiwiYXVkIjoiaHR0cHM6Ly9naXRodWIuY29tL3BhcGVyLXNwYSIsInJlZiI6InJlZnMvaGVhZHMvbWFpbiIsInNoYSI6ImEyODU1MWJmODdiZDk3NTFiMzdiMmM0YjM3M2MxZjU3NjFmYWM2MjYiLCJyZXBvc2l0b3J5IjoicGFwZXItc3BhL21pbnlpIiwicmVwb3NpdG9yeV9vd25lciI6InBhcGVyLXNwYSIsInJ1bl9pZCI6IjE1NDY0NTkzNjQiLCJydW5fbnVtYmVyIjoiMzQiLCJydW5fYXR0ZW1wdCI6IjIiLCJhY3RvciI6IllpTXlzdHkiLCJ3b3JrZmxvdyI6IkNJIiwiaGVhZF9yZWYiOiIiLCJiYXNlX3JlZiI6IiIsImV2ZW50X25hbWUiOiJwdXNoIiwicmVmX3R5cGUiOiJicmFuY2giLCJlbnZpcm9ubWVudCI6IlByb2R1Y3Rpb24iLCJqb2Jfd29ya2Zsb3dfcmVmIjoicGFwZXItc3BhL21pbnlpLy5naXRodWIvd29ya2Zsb3dzL2JsYW5rLnltbEByZWZzL2hlYWRzL21haW4iLCJpc3MiOiJodHRwczovL3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwibmJmIjoxNjM4ODI4MDI4LCJleHAiOjE2Mzg4Mjg5MjgsImlhdCI6MTYzODgyODYyOH0.1wyupfxu1HGoTyIqatYg0hIxy2-0bMO-yVlmLSMuu2w' 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNjllMWIxOC1jOGFiLTRhZGQtOGYxOC03MzVlMzVjZGJhZjAiLCJzdWIiOiJyZXBvOnBhcGVyLXNwYS9taW55aTplbnZpcm9ubWVudDpQcm9kdWN0aW9uIiwiYXVkIjoiaHR0cHM6Ly9naXRodWIuY29tL3BhcGVyLXNwYSIsInJlZiI6InJlZnMvaGVhZHMvbWFpbiIsInNoYSI6ImEyODU1MWJmODdiZDk3NTFiMzdiMmM0YjM3M2MxZjU3NjFmYWM2MjYiLCJyZXBvc2l0b3J5IjoicGFwZXItc3BhL21pbnlpIiwicmVwb3NpdG9yeV9vd25lciI6InBhcGVyLXNwYSIsInJ1bl9pZCI6IjE1NDY0NTkzNjQiLCJydW5fbnVtYmVyIjoiMzQiLCJydW5fYXR0ZW1wdCI6IjIiLCJhY3RvciI6IllpTXlzdHkiLCJ3b3JrZmxvdyI6IkNJIiwiaGVhZF9yZWYiOiIiLCJiYXNlX3JlZiI6IiIsImV2ZW50X25hbWUiOiJwdXNoIiwicmVmX3R5cGUiOiJicmFuY2giLCJlbnZpcm9ubWVudCI6IlByb2R1Y3Rpb24iLCJqb2Jfd29ya2Zsb3dfcmVmIjoicGFwZXItc3BhL21pbnlpLy5naXRodWIvd29ya2Zsb3dzL2JsYW5rLnltbEByZWZzL2hlYWRzL21haW4iLCJpc3MiOiJodHRwczovL3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwibmJmIjoxNjM4ODI4MDI4LCJleHAiOjE2Mzg4Mjg5MjgsImlhdCI6MTYzODgyODYyOH0.1wyupfxu1HGoTyIqatYg0hIxy2-0bMO-yVlmLSMuu2w'
describe('Deployment', () => { describe('Deployment', () => {
let mockPool
beforeEach(() => { beforeEach(() => {
jest.clearAllMocks() jest.clearAllMocks()
process.env.ACTIONS_RUNTIME_URL = 'http://my-url/' process.env.ACTIONS_RUNTIME_URL = 'http://my-url/'
@@ -25,6 +30,8 @@ describe('Deployment', () => {
return 'github-pages' return 'github-pages'
case 'token': case 'token':
return process.env.GITHUB_TOKEN return process.env.GITHUB_TOKEN
case 'reporting_interval':
return 50 // Lower reporting interval to speed up test
default: default:
return process.env[`INPUT_${param.toUpperCase()}`] || '' return process.env[`INPUT_${param.toUpperCase()}`] || ''
} }
@@ -37,11 +44,18 @@ describe('Deployment', () => {
jest.spyOn(core, 'setFailed').mockImplementation(param => { jest.spyOn(core, 'setFailed').mockImplementation(param => {
return param return param
}) })
// Mock error/warning/info/debug // Mock error/warning/info/debug
jest.spyOn(core, 'error').mockImplementation(jest.fn()) jest.spyOn(core, 'error').mockImplementation(jest.fn())
jest.spyOn(core, 'warning').mockImplementation(jest.fn()) jest.spyOn(core, 'warning').mockImplementation(jest.fn())
jest.spyOn(core, 'info').mockImplementation(jest.fn()) jest.spyOn(core, 'info').mockImplementation(jest.fn())
jest.spyOn(core, 'debug').mockImplementation(jest.fn()) jest.spyOn(core, 'debug').mockImplementation(jest.fn())
// Set up Fetch mocking
const mockAgent = new MockAgent()
mockAgent.disableNetConnect()
setGlobalDispatcher(mockAgent)
mockPool = mockAgent.get('https://api.github.com')
}) })
describe('#create', () => { describe('#create', () => {
@@ -62,16 +76,32 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.pages_build_version === process.env.GITHUB_SHA &&
body.oidc_token === fakeJwt
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
@@ -85,7 +115,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('can successfully create a preview deployment', async () => { it('can successfully create a preview deployment', async () => {
@@ -100,18 +129,35 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt, body: bodyString => {
preview: true const body = JSON.parse(bodyString)
}) const keys = Object.keys(body).sort()
.reply(200, { return (
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, keys.length === 4 &&
page_url: 'https://actions.github.io/is-awesome', keys[0] === 'artifact_url' &&
preview_url: 'https://actions.drafts.github.io/is-awesome' keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
keys[3] === 'preview' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.pages_build_version === process.env.GITHUB_SHA &&
body.oidc_token === fakeJwt &&
body.preview === true
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome',
preview_url: 'https://actions.drafts.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
@@ -128,7 +174,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('reports errors with failed artifact exchange', async () => { it('reports errors with failed artifact exchange', async () => {
@@ -154,12 +199,23 @@ describe('Deployment', () => {
.get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview') .get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview')
.reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] }) .reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA method: 'POST',
body: bodyString => {
const body = JSON.parse(bodyString)
const keys = Object.keys(body).sort()
return (
keys.length === 2 &&
keys[0] === 'artifact_url' &&
keys[1] === 'pages_build_version' &&
body.artifact_url === 'https://invalid-artifact.com&%24expand=SignedContent' &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(500, { message: 'oh no' }) .reply(500, { message: 'oh no' }, { headers: { 'content-type': 'application/json' } })
// Create the deployment // Create the deployment
const deployment = new Deployment() const deployment = new Deployment()
@@ -170,7 +226,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('reports errors with an unexpected 403 during deployment', async () => { it('reports errors with an unexpected 403 during deployment', async () => {
@@ -179,12 +234,23 @@ describe('Deployment', () => {
.get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview') .get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview')
.reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] }) .reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA method: 'POST',
body: bodyString => {
const body = JSON.parse(bodyString)
const keys = Object.keys(body).sort()
return (
keys.length === 2 &&
keys[0] === 'artifact_url' &&
keys[1] === 'pages_build_version' &&
body.artifact_url === 'https://invalid-artifact.com&%24expand=SignedContent' &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(403, { message: 'You are forbidden' }) .reply(403, { message: 'You are forbidden' }, { headers: { 'content-type': 'application/json' } })
// Create the deployment // Create the deployment
const deployment = new Deployment() const deployment = new Deployment()
@@ -195,7 +261,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('reports errors with an unexpected 404 during deployment', async () => { it('reports errors with an unexpected 404 during deployment', async () => {
@@ -204,12 +269,23 @@ describe('Deployment', () => {
.get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview') .get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview')
.reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] }) .reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA method: 'POST',
body: bodyString => {
const body = JSON.parse(bodyString)
const keys = Object.keys(body).sort()
return (
keys.length === 2 &&
keys[0] === 'artifact_url' &&
keys[1] === 'pages_build_version' &&
body.artifact_url === 'https://invalid-artifact.com&%24expand=SignedContent' &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(404, { message: 'Not found' }) .reply(404, { message: 'Not found' }, { headers: { 'content-type': 'application/json' } })
// Create the deployment // Create the deployment
const deployment = new Deployment() const deployment = new Deployment()
@@ -220,7 +296,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('reports errors with failed deployments', async () => { it('reports errors with failed deployments', async () => {
@@ -229,12 +304,23 @@ describe('Deployment', () => {
.get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview') .get('/_apis/pipelines/workflows/123/artifacts?api-version=6.0-preview')
.reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] }) .reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA method: 'POST',
body: bodyString => {
const body = JSON.parse(bodyString)
const keys = Object.keys(body).sort()
return (
keys.length === 2 &&
keys[0] === 'artifact_url' &&
keys[1] === 'pages_build_version' &&
body.artifact_url === 'https://invalid-artifact.com&%24expand=SignedContent' &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(400, { message: 'Bad request' }) .reply(400, { message: 'Bad request' }, { headers: { 'content-type': 'application/json' } })
// Create the deployment // Create the deployment
const deployment = new Deployment() const deployment = new Deployment()
@@ -245,7 +331,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('warns if the artifact size is bigger than maximum', async () => { it('warns if the artifact size is bigger than maximum', async () => {
@@ -261,16 +346,32 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const deployment = new Deployment() const deployment = new Deployment()
await deployment.create(fakeJwt) await deployment.create(fakeJwt)
@@ -284,7 +385,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('warns when the timeout is greater than the maximum allowed', async () => { it('warns when the timeout is greater than the maximum allowed', async () => {
@@ -299,25 +399,44 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
// Set timeout to greater than max
jest.spyOn(core, 'getInput').mockImplementation(param => { jest.spyOn(core, 'getInput').mockImplementation(param => {
switch (param) { switch (param) {
case 'artifact_name': case 'artifact_name':
return 'github-pages' return 'github-pages'
case 'token': case 'token':
return process.env.GITHUB_TOKEN return process.env.GITHUB_TOKEN
case 'reporting_interval':
return 50 // Lower reporting interval to speed up test
case 'timeout': case 'timeout':
return MAX_TIMEOUT + 1 return MAX_TIMEOUT + 1
default: default:
@@ -333,7 +452,6 @@ describe('Deployment', () => {
) )
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
}) })
@@ -350,22 +468,39 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const deploymentStatusScope = nock('https://api.github.com') mockPool
.get(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`) .intercept({
.reply(200, { path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
status: 'succeed' method: 'GET'
}) })
.reply(200, { status: 'succeed' }, { headers: { 'content-type': 'application/json' } })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
@@ -378,8 +513,6 @@ describe('Deployment', () => {
expect(core.info).toHaveBeenLastCalledWith('Reported success!') expect(core.info).toHaveBeenLastCalledWith('Reported success!')
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
deploymentStatusScope.done()
}) })
it('fails check when no deployment is found', async () => { it('fails check when no deployment is found', async () => {
@@ -401,16 +534,32 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
@@ -421,7 +570,6 @@ describe('Deployment', () => {
expect(core.setFailed).toBeCalledWith('Unable to get deployment status.') expect(core.setFailed).toBeCalledWith('Unable to get deployment status.')
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
}) })
it('enforces max timeout', async () => { it('enforces max timeout', async () => {
@@ -436,24 +584,51 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const cancelDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`) .intercept({
.reply(200, {}) path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
method: 'GET'
})
.reply(200, { status: 'deployment_in_progress' }, { headers: { 'content-type': 'application/json' } })
.times(2)
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`,
method: 'POST'
})
.reply(200, {}, { headers: { 'content-type': 'application/json' } })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
// Set timeout to great than max // Set timeout to greater than max
jest.spyOn(core, 'getInput').mockImplementation(param => { jest.spyOn(core, 'getInput').mockImplementation(param => {
switch (param) { switch (param) {
case 'artifact_name': case 'artifact_name':
@@ -462,6 +637,8 @@ describe('Deployment', () => {
return process.env.GITHUB_TOKEN return process.env.GITHUB_TOKEN
case 'error_count': case 'error_count':
return 10 return 10
case 'reporting_interval':
return 50 // Lower the interval for the test
case 'timeout': case 'timeout':
return MAX_TIMEOUT + 1 return MAX_TIMEOUT + 1
default: default:
@@ -469,25 +646,26 @@ describe('Deployment', () => {
} }
}) })
const now = Date.now() // Jump the "current time" by MAX_TIMEOUT ever time Date.now is called
const mockStartTime = now - MAX_TIMEOUT const _now = Date.now
jest let nowCalls = 0
.spyOn(Date, 'now') const nowSpy = jest.spyOn(Date, 'now').mockImplementation(() => {
.mockImplementationOnce(() => mockStartTime) nowCalls++
.mockImplementationOnce(() => now) return _now() + MAX_TIMEOUT * nowCalls
})
// Create the deployment // Create the deployment
const deployment = new Deployment() const deployment = new Deployment()
await deployment.create(fakeJwt) await deployment.create(fakeJwt)
await deployment.check() await deployment.check()
nowSpy.mockRestore()
expect(deployment.timeout).toEqual(MAX_TIMEOUT) expect(deployment.timeout).toEqual(MAX_TIMEOUT)
expect(core.error).toBeCalledWith('Timeout reached, aborting!') expect(core.error).toBeCalledWith('Timeout reached, aborting!')
expect(core.setFailed).toBeCalledWith('Timeout reached, aborting!') expect(core.setFailed).toBeCalledWith('Timeout reached, aborting!')
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
cancelDeploymentScope.done()
}) })
it('sets timeout to user timeout if user timeout is less than max timeout', async () => { it('sets timeout to user timeout if user timeout is less than max timeout', async () => {
@@ -502,24 +680,43 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const cancelDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`) .intercept({
.reply(200, {}) path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`,
method: 'POST'
})
.reply(200, {}, { headers: { 'content-type': 'application/json' } })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
// Set timeout to great than max // Set timeout to greater than max
jest.spyOn(core, 'getInput').mockImplementation(param => { jest.spyOn(core, 'getInput').mockImplementation(param => {
switch (param) { switch (param) {
case 'artifact_name': case 'artifact_name':
@@ -528,6 +725,8 @@ describe('Deployment', () => {
return process.env.GITHUB_TOKEN return process.env.GITHUB_TOKEN
case 'error_count': case 'error_count':
return 10 return 10
case 'reporting_interval':
return 42 // The default of 5000 is too long for the test
case 'timeout': case 'timeout':
return 42 return 42
default: default:
@@ -552,8 +751,6 @@ describe('Deployment', () => {
expect(core.setFailed).toBeCalledWith('Timeout reached, aborting!') expect(core.setFailed).toBeCalledWith('Timeout reached, aborting!')
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
cancelDeploymentScope.done()
}) })
it('sets output to success when timeout is set but not reached', async () => { it('sets output to success when timeout is set but not reached', async () => {
@@ -568,26 +765,43 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const deploymentStatusScope = nock('https://api.github.com') mockPool
.get(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`) .intercept({
.reply(200, { path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
status: 'succeed' method: 'GET'
}) })
.reply(200, { status: 'succeed' }, { headers: { 'content-type': 'application/json' } })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
// Set timeout to great than max // Set timeout to greater than max
jest.spyOn(core, 'getInput').mockImplementation(param => { jest.spyOn(core, 'getInput').mockImplementation(param => {
switch (param) { switch (param) {
case 'artifact_name': case 'artifact_name':
@@ -596,6 +810,8 @@ describe('Deployment', () => {
return process.env.GITHUB_TOKEN return process.env.GITHUB_TOKEN
case 'error_count': case 'error_count':
return 10 return 10
case 'reporting_interval':
return 0 // The default of 5000 is too long for the test
case 'timeout': case 'timeout':
return 42 return 42
default: default:
@@ -604,7 +820,7 @@ describe('Deployment', () => {
}) })
const now = Date.now() const now = Date.now()
const mockStartTime = now const mockStartTime = now // No time elapsed
jest jest
.spyOn(Date, 'now') .spyOn(Date, 'now')
.mockImplementationOnce(() => mockStartTime) .mockImplementationOnce(() => mockStartTime)
@@ -621,8 +837,6 @@ describe('Deployment', () => {
expect(core.info).toHaveBeenLastCalledWith('Reported success!') expect(core.info).toHaveBeenLastCalledWith('Reported success!')
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
deploymentStatusScope.done()
}) })
}) })
@@ -639,20 +853,39 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const cancelDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`) .intercept({
.reply(200, {}) path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`,
method: 'POST'
})
.reply(200, {}, { headers: { 'content-type': 'application/json' } })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
@@ -666,8 +899,6 @@ describe('Deployment', () => {
expect(core.info).toHaveBeenLastCalledWith(`Canceled deployment with ID ${process.env.GITHUB_SHA}`) expect(core.info).toHaveBeenLastCalledWith(`Canceled deployment with ID ${process.env.GITHUB_SHA}`)
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
cancelDeploymentScope.done()
}) })
it('can exit if a pages deployment was not created and none need to be cancelled', async () => { it('can exit if a pages deployment was not created and none need to be cancelled', async () => {
@@ -695,21 +926,39 @@ describe('Deployment', () => {
] ]
}) })
const createDeploymentScope = nock('https://api.github.com') mockPool
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, { .intercept({
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent', path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
pages_build_version: process.env.GITHUB_SHA, method: 'POST',
oidc_token: fakeJwt body: bodyString => {
}) const body = JSON.parse(bodyString)
.reply(200, { const keys = Object.keys(body).sort()
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`, return (
page_url: 'https://actions.github.io/is-awesome' keys.length === 3 &&
keys[0] === 'artifact_url' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_url === 'https://fake-artifact.com&%24expand=SignedContent' &&
body.oidc_token === fakeJwt &&
body.pages_build_version === process.env.GITHUB_SHA
)
}
}) })
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
// nock will throw an error every time it tries to cancel the deployment mockPool
const cancelDeploymentScope = nock('https://api.github.com') .intercept({
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`) path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`,
.reply(500, {}) method: 'POST'
})
.reply(500, {}, { headers: { 'content-type': 'application/json' } })
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt) core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
@@ -723,8 +972,6 @@ describe('Deployment', () => {
expect(core.error).toHaveBeenCalledWith(`Canceling Pages deployment failed`, expect.anything()) expect(core.error).toHaveBeenCalledWith(`Canceling Pages deployment failed`, expect.anything())
artifactExchangeScope.done() artifactExchangeScope.done()
createDeploymentScope.done()
cancelDeploymentScope.done()
}) })
}) })
}) })

View File

@@ -17,7 +17,7 @@ const temporaryErrorStatus = {
const finalErrorStatus = { const finalErrorStatus = {
deployment_failed: 'Deployment failed, try again later.', deployment_failed: 'Deployment failed, try again later.',
deployment_perms_error: 'Deployment failed, Please ensure that the file permissions are correct.', deployment_perms_error: 'Deployment failed. Please ensure that the file permissions are correct.',
deployment_content_failed: 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.', '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_cancelled: 'Deployment cancelled.',
@@ -102,9 +102,6 @@ class Deployment {
} catch (error) { } catch (error) {
core.error(error.stack) core.error(error.stack)
// output raw error in debug mode.
core.debug(JSON.stringify(error))
// build customized error message based on server response // build customized error message based on server response
if (error.response) { if (error.response) {
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}. ` let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}. `
@@ -189,9 +186,6 @@ class Deployment {
} catch (error) { } catch (error) {
core.error(error.stack) core.error(error.stack)
// output raw error in debug mode.
core.debug(JSON.stringify(error))
// build customized error message based on server response // build customized error message based on server response
if (error.response) { if (error.response) {
errorStatus = error.status || error.response.status errorStatus = error.status || error.response.status