284 Commits
v0 ... v3.0.6

Author SHA1 Message Date
James M. Greene
f156874f81 Merge pull request #89 from actions/dependabot/npm_and_yarn/eslint-8.38.0
Bump eslint from 8.36.0 to 8.38.0
2023-04-16 09:26:22 -05:00
github-actions[bot]
fe71f9ae5d Update distributables after Dependabot 🤖 2023-04-16 14:25:21 +00:00
dependabot[bot]
41eccaebbe Bump eslint from 8.36.0 to 8.38.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.36.0 to 8.38.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.36.0...v8.38.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-04-16 14:24:56 +00:00
James M. Greene
9cb82625f8 Merge pull request #86 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-04-16 09:24:02 -05:00
dependabot[bot]
fadcf1a88f 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-04-16 14:22:45 +00:00
James M. Greene
1269962883 Merge pull request #85 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-04-16 09:22:09 -05:00
dependabot[bot]
ee9b267268 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-04-16 14:21:27 +00:00
James M. Greene
3f3c78f313 Merge pull request #84 from actions/dependabot/npm_and_yarn/prettier-2.8.7
Bump prettier from 2.8.6 to 2.8.7
2023-04-16 09:20:47 -05:00
dependabot[bot]
22baedcbd5 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-16 14:19:11 +00:00
James M. Greene
5549504006 Merge pull request #83 from WofWca/better-error-message
Make "Get Pages failed" error message more helpful
2023-04-16 09:18:11 -05:00
James M. Greene
dbf7935b84 Reformat error message 2023-04-16 09:16:27 -05:00
WofWca
905065c25d Fix missing space 2023-03-30 14:55:29 +08:00
WofWca
17109fe139 Make "Get Pages failed" error message more helpful 2023-03-25 14:57:08 +00:00
James M. Greene
2a4c30ee0a Merge pull request #81 from actions/dependabot/npm_and_yarn/prettier-2.8.6
Bump prettier from 2.8.4 to 2.8.6
2023-03-22 15:34:18 -05:00
dependabot[bot]
031419c070 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:33:30 +00:00
James M. Greene
17d80648a1 Merge pull request #68 from actions/codeql-workflow
Add a CodeQL security scanning workflow
2023-03-22 15:31:28 -05:00
James M. Greene
f207b2fdea Merge branch 'main' into codeql-workflow 2023-03-22 15:29:25 -05:00
James M. Greene
7110e9e03f Merge pull request #77 from actions/dependabot/npm_and_yarn/jest-29.5.0
Bump jest from 29.4.3 to 29.5.0
2023-03-14 20:40:47 -05:00
dependabot[bot]
2139388aaf 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-15 01:40:07 +00:00
James M. Greene
1249305e58 Merge pull request #76 from actions/dependabot/npm_and_yarn/eslint-8.36.0
Bump eslint from 8.35.0 to 8.36.0
2023-03-14 20:39:19 -05:00
dependabot[bot]
29466e6602 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:38:36 +00:00
James M. Greene
596b326b9b Merge pull request #78 from actions/dependabot/npm_and_yarn/espree-9.5.0
Bump espree from 9.4.1 to 9.5.0
2023-03-14 20:37:26 -05:00
github-actions[bot]
0f0e83884b Update distributables after Dependabot 🤖 2023-03-13 11:07:55 +00:00
dependabot[bot]
fb49e2740e Bump espree from 9.4.1 to 9.5.0
Bumps [espree](https://github.com/eslint/espree) from 9.4.1 to 9.5.0.
- [Release notes](https://github.com/eslint/espree/releases)
- [Changelog](https://github.com/eslint/espree/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/espree/compare/v9.4.1...v9.5.0)

---
updated-dependencies:
- dependency-name: espree
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 11:07:25 +00:00
James M. Greene
8255d25c18 Merge pull request #75 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-06 22:25:25 -06:00
dependabot[bot]
425a42e364 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-06 11:10:22 +00:00
James M. Greene
e9cfa1e1db Merge pull request #73 from actions/dependabot/npm_and_yarn/eslint-8.35.0
Bump eslint from 8.34.0 to 8.35.0
2023-03-02 16:50:01 -06:00
dependabot[bot]
d11b920341 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-02-27 11:09:20 +00:00
James M. Greene
84ab70e745 Merge pull request #72 from actions/dependabot/npm_and_yarn/jest-29.4.3
Bump jest from 29.4.1 to 29.4.3
2023-02-23 00:58:46 -06:00
dependabot[bot]
b287dc6263 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 06:57:57 +00:00
James M. Greene
f92583d4ab Merge pull request #71 from actions/dependabot/npm_and_yarn/eslint-plugin-github-4.6.1
Bump eslint-plugin-github from 4.6.0 to 4.6.1
2023-02-23 00:57:11 -06:00
dependabot[bot]
231f4e0d00 Bump eslint-plugin-github from 4.6.0 to 4.6.1
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.6.0...v4.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 11:11:33 +00:00
James M. Greene
dfe5b0f888 Merge pull request #51 from actions/document-token-options
Amend token coverage for enablement in Action metadata file
2023-02-16 12:54:32 -06:00
James M. Greene
0b5c9335ec Merge branch 'main' into document-token-options 2023-02-16 12:52:38 -06:00
James M. Greene
457b08648b Add some backticks 2023-02-16 12:52:17 -06:00
James M. Greene
406a88e3a9 Update wording
Based on https://docs.github.com/en/rest/pages?apiVersion=2022-11-28#create-a-github-pages-site

Co-authored-by: Yoann Chaudet <yoannchaudet@github.com>
2023-02-16 12:51:13 -06:00
James M. Greene
fc89b04e7d Merge branch 'jeremy-daley-kr-main' 2023-02-16 07:09:41 -06:00
James M. Greene
83d8e1aa25 Update distributables 2023-02-16 07:07:02 -06:00
James M. Greene
9b64f8160b Remove unused GITHUB_REPOSITORY context entry 2023-02-16 07:05:00 -06:00
James M. Greene
5a875285a3 Add build_type parameter back to API call 2023-02-16 07:04:28 -06:00
James M. Greene
873190cca3 Remove axios as a dependency 2023-02-16 06:59:13 -06:00
dependabot[bot]
ca9e52a2a5 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-16 06:56:46 -06:00
dependabot[bot]
32d8c4da59 Bump prettier from 2.7.1 to 2.8.4
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 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.7.1...2.8.4)

---
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-16 06:54:46 -06:00
dependabot[bot]
e89f5c9189 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-16 06:54:46 -06:00
dependabot[bot]
f46cda8a64 Bump @vercel/ncc from 0.34.0 to 0.36.1
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.34.0 to 0.36.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.34.0...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-02-16 06:54:46 -06:00
github-actions[bot]
cc656c2b3d Update distributables after Dependabot 🤖 2023-02-16 06:54:43 -06:00
dependabot[bot]
28756f76e4 Bump espree from 9.4.0 to 9.4.1
Bumps [espree](https://github.com/eslint/espree) from 9.4.0 to 9.4.1.
- [Release notes](https://github.com/eslint/espree/releases)
- [Changelog](https://github.com/eslint/espree/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/espree/compare/v9.4.0...v9.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 06:54:06 -06:00
James M. Greene
e3c441b6cf Add workflow to rebuild Dependabot PRs 2023-02-16 06:54:06 -06:00
James M. Greene
23968016b8 Merge pull request #70 from actions/dependabot/npm_and_yarn/axios-1.3.3
Bump axios from 1.3.0 to 1.3.3
2023-02-16 06:49:36 -06:00
github-actions[bot]
3d4ee3e950 Update distributables after Dependabot 🤖 2023-02-16 12:48:56 +00:00
dependabot[bot]
cdda64832d 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-16 12:48:25 +00:00
James M. Greene
38eb20d0ee Merge pull request #66 from actions/dependabot/npm_and_yarn/prettier-2.8.4
Bump prettier from 2.7.1 to 2.8.4
2023-02-16 06:41:19 -06:00
dependabot[bot]
36b9431494 Bump prettier from 2.7.1 to 2.8.4
Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 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.7.1...2.8.4)

---
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-16 12:38:21 +00:00
James M. Greene
179e061a24 Merge pull request #65 from actions/dependabot/npm_and_yarn/eslint-8.34.0
Bump eslint from 8.33.0 to 8.34.0
2023-02-16 06:37:29 -06:00
dependabot[bot]
175172ab3d 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-16 12:36:11 +00:00
James M. Greene
685a74a557 Merge pull request #61 from actions/dependabot/npm_and_yarn/vercel/ncc-0.36.1
Bump @vercel/ncc from 0.34.0 to 0.36.1
2023-02-16 06:35:22 -06:00
dependabot[bot]
84be8935f1 Bump @vercel/ncc from 0.34.0 to 0.36.1
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.34.0 to 0.36.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.34.0...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-02-16 12:28:06 +00:00
James M. Greene
24bc4a64af Merge pull request #59 from actions/dependabot/npm_and_yarn/espree-9.4.1
Bump espree from 9.4.0 to 9.4.1
2023-02-16 06:27:22 -06:00
github-actions[bot]
ea72118a93 Update distributables after Dependabot 🤖 2023-02-16 12:26:05 +00:00
dependabot[bot]
f98f257726 Bump espree from 9.4.0 to 9.4.1
Bumps [espree](https://github.com/eslint/espree) from 9.4.0 to 9.4.1.
- [Release notes](https://github.com/eslint/espree/releases)
- [Changelog](https://github.com/eslint/espree/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/espree/compare/v9.4.0...v9.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 12:25:35 +00:00
James M. Greene
995b240285 Merge pull request #69 from actions/rebuild-dependabot-prs
Add workflow to rebuild Dependabot PRs
2023-02-16 06:24:14 -06:00
James M. Greene
c6c1171c00 Add workflow to rebuild Dependabot PRs 2023-02-15 19:08:30 -06:00
James M. Greene
ea6c51c96e Add a CodeQL security scanning workflow 2023-02-15 19:04:56 -06:00
Jeremy Daley
8ece2a9a22 prettier fix 2023-02-13 17:04:37 -05:00
Jeremy Daley
54f3ebf2d1 remove https-proxy-agent 2023-02-10 03:14:20 -05:00
Jeremy Daley
c8baff747f remove action proxy input 2023-02-10 03:13:31 -05:00
Jeremy Daley
549319b80b fix tests 2023-02-10 03:11:16 -05:00
Jeremy Daley
7d88dd59cd use github actions packages 2023-02-10 02:30:56 -05:00
Jeremy Daley
b1748b08d7 try some stuff 2023-02-10 02:10:06 -05:00
Jeremy Daley
66f86d58c8 prepare 2023-02-10 01:44:55 -05:00
Jeremy Daley
d8adc44149 you kidding me? 2023-02-10 01:44:40 -05:00
Jeremy Daley
50408c8053 try some logging 2023-02-10 01:39:32 -05:00
Jeremy Daley
ccd0e3abe9 forgot to prepare also 2023-02-10 01:33:47 -05:00
Jeremy Daley
a4a37a13a6 forgot to forward proxy through 2023-02-10 01:33:13 -05:00
Jeremy Daley
4bfe138e84 modified to use proxy input 2023-02-10 01:28:34 -05:00
James M. Greene
37538b280c Merge pull request #56 from actions/dependabot/npm_and_yarn/axios-1.3.0
Bump axios from 0.27.2 to 1.3.0
2023-02-01 11:22:00 -06:00
James M. Greene
8d642d8eae Update distributables 2023-02-01 11:21:15 -06:00
dependabot[bot]
9b8d2f4ab2 Bump axios from 0.27.2 to 1.3.0
Bumps [axios](https://github.com/axios/axios) from 0.27.2 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.27.2...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 17:19:53 +00:00
James M. Greene
e2f34b1f92 Merge pull request #58 from actions/dependabot/npm_and_yarn/jest-29.4.1
Bump jest from 28.1.1 to 29.4.1
2023-02-01 11:19:26 -06:00
dependabot[bot]
7aebbf763e Bump jest from 28.1.1 to 29.4.1
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.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 17:18:41 +00:00
James M. Greene
6a2b91eafe Merge pull request #57 from actions/dependabot/npm_and_yarn/eslint-plugin-github-4.6.0
Bump eslint-plugin-github from 4.3.7 to 4.6.0
2023-02-01 11:17:49 -06:00
dependabot[bot]
939d05ad85 Bump eslint-plugin-github from 4.3.7 to 4.6.0
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.3.7 to 4.6.0.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.3.7...v4.6.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-02-01 17:16:27 +00:00
James M. Greene
0ca1df54d4 Merge pull request #55 from actions/dependabot/npm_and_yarn/eslint-config-prettier-8.6.0
Bump eslint-config-prettier from 8.5.0 to 8.6.0
2023-02-01 11:15:11 -06:00
dependabot[bot]
5c42783e5b Bump eslint-config-prettier from 8.5.0 to 8.6.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.5.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.5.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 17:14:28 +00:00
James M. Greene
13d4de8a28 Merge pull request #54 from actions/dependabot/npm_and_yarn/eslint-8.33.0
Bump eslint from 8.23.1 to 8.33.0
2023-02-01 11:08:42 -06:00
James M. Greene
5aa8bf5ac6 Merge branch 'main' into dependabot/npm_and_yarn/eslint-8.33.0 2023-02-01 11:08:09 -06:00
James M. Greene
1d79de2fe7 Merge pull request #53 from actions/test-set-pages-config
Update tests to actually invoke the desired method instead of replicating it
2023-02-01 11:00:46 -06:00
dependabot[bot]
5a80553d12 Bump eslint from 8.23.1 to 8.33.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.1 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.23.1...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 17:00:40 +00:00
James M. Greene
7eb7a15548 Merge branch 'main' into test-set-pages-config 2023-02-01 11:00:11 -06:00
James M. Greene
b8c94fdc9e Merge pull request #52 from actions/dependabot-npm-updates
Add npm to Dependabot update list
2023-02-01 10:59:58 -06:00
James M. Greene
9b358e73bb Update tests to actually invoke the desired method instead of replicating it 2023-01-30 23:51:40 -06:00
James M. Greene
13e6bc7a20 Add npm to Dependabot update list 2023-01-30 22:11:54 -06:00
James M. Greene
0968db9eff Amend token coverage for enablement in Action metadata file 2023-01-30 18:45:25 -06:00
James M. Greene
3c444c051b Merge pull request #50 from actions/fix-enablement
Fix `enablement` logic in v3
2023-01-30 12:34:00 -06:00
James M. Greene
12fd9a085c Update distributables 2023-01-30 12:29:45 -06:00
James M. Greene
a8216d627c Fix enablement logic for v3 2023-01-30 12:29:09 -06:00
James M. Greene
5992ce8fd5 Merge pull request #48 from actions/do-not-enable-by-default
Update default behavior to NOT attempt to create/enable the Pages site
2023-01-18 15:13:37 -06:00
James M. Greene
c8deda3832 Update distributables 2023-01-18 15:03:42 -06:00
James M. Greene
5d8963e8a5 Update default behavior to NOT attempt to create/enable the Pages site 2023-01-18 15:03:22 -06:00
James M. Greene
529ba710d5 Merge pull request #47 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-18 14:56:58 -06:00
dependabot[bot]
29e9dd5abe 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-18 20:56:23 +00:00
James M. Greene
c450a282d7 Merge pull request #45 from actions/dependabot/npm_and_yarn/json5-1.0.2
Bump json5 from 1.0.1 to 1.0.2
2023-01-18 14:55:38 -06:00
dependabot[bot]
6567d4c154 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-18 20:53:57 +00:00
James M. Greene
aba1aa6bab Merge pull request #46 from actions/dependabot-config
Add Dependabot config for Actions usage updates
2023-01-13 16:37:40 -06:00
James M. Greene
6a80311a73 Comply with Prettier expectations 2023-01-13 16:34:06 -06:00
James M. Greene
380c12d4cc Add Dependabot config for Actions usage updates 2023-01-13 15:59:46 -06:00
James M. Greene
c5a3e1159e Merge pull request #43 from actions/warn-unsupported-exts
Warn about unsupported file extensions after erring
2022-11-23 09:32:16 -06:00
James M. Greene
a069fede0c Update distributables after updating deps 2022-11-22 23:17:34 -06:00
James M. Greene
2f460cfbe0 Update distributables 2022-11-22 23:11:12 -06:00
James M. Greene
e5c1ee9f14 Reformat 2022-11-22 23:10:56 -06:00
James M. Greene
7fea7010df Minor revisions 2022-11-22 23:10:56 -06:00
James M. Greene
34521f23a5 Add warn for unsupported extensions 2022-11-22 23:10:37 -06:00
James M. Greene
d84b27279d Merge pull request #42 from actions/JamesMGreene-patch-1
Update to the latest `actions/publish-action`
2022-11-22 22:29:53 -06:00
James M. Greene
5650def507 Update to the latest actions/publish-action
To avoid Actions core deprecation messages.

https://github.com/actions/publish-action/releases/tag/v0.2.1
2022-11-22 22:29:07 -06:00
James M. Greene
0c2178e929 Merge pull request #41 from actions/alt-blank-extensions
Test: Better support alternative file extensions for blank config files
2022-11-22 21:35:02 -06:00
James M. Greene
948e60fb96 Reformat 2022-11-22 21:34:10 -06:00
James M. Greene
1305a1ba92 Better support alternative file extensions for blank config files in the tests 2022-11-22 21:30:53 -06:00
James M. Greene
b94e9adb36 Merge pull request #38 from actions/support-wrapped-exports
Support wrapped exports
2022-11-21 16:57:31 -06:00
James M. Greene
fc8c2c4e6e Update the distributables 2022-11-21 13:12:55 -06:00
James M. Greene
e978eba337 Add support for indirect config declarator in chained declaration statement 2022-11-21 13:12:45 -06:00
James M. Greene
343cb08233 Add tests for when multiple declarations are chained together 2022-11-21 12:36:09 -06:00
James M. Greene
f87a94c875 Update the distributables 2022-11-21 12:15:34 -06:00
James M. Greene
7eb40247a7 Format 2022-11-21 12:14:59 -06:00
James M. Greene
86f141f32d Add support for 'Indirect module export with a wrapping call at the export' 2022-11-21 12:12:47 -06:00
James M. Greene
76b6a8292e Small corrections 2022-11-21 12:08:39 -06:00
James M. Greene
8e221f24db Add support for 'Indirect module export with a wrapping call at the definition' 2022-11-21 12:05:26 -06:00
James M. Greene
d897860efd Add support for 'Indirect default export with a wrapping call at the export' 2022-11-21 11:34:58 -06:00
James M. Greene
24270f0cca Add support for 'Indirect default export with a wrapping call at the definition' 2022-11-21 11:04:42 -06:00
James M. Greene
0c3c14948a Merge branch 'main' into support-wrapped-exports 2022-11-18 01:02:58 -06:00
James M. Greene
b0c19d0de9 Merge pull request #37 from actions/merge-pr-33
Merge PR #33
2022-11-18 01:01:12 -06:00
James M. Greene
51323db177 Fix the Next.js tests 2022-11-18 00:57:58 -06:00
James M. Greene
3d9811d6e2 Update distributables 2022-11-18 00:56:40 -06:00
James M. Greene
9c3b6344a2 Merge branch 'main' into patch-1 2022-11-18 00:50:11 -06:00
James M. Greene
97fb35057c Add comment 2022-11-18 00:50:00 -06:00
James M. Greene
c917d1c3cd Merge pull request #35 from actions/bump-actions
Bump actions
2022-11-18 00:46:30 -06:00
James M. Greene
ffa824f004 Start making some of those tests pass 2022-11-18 00:45:01 -06:00
James M. Greene
d4a76d1ee1 Add unit tests to verify support for function-wrapped exports 2022-11-18 00:29:31 -06:00
Yoann Chaudet
bd8a5da49f Bump actions 2022-10-31 16:34:08 -07:00
Kapil Koju
5cb77813a2 Add back experimental.images.unoptimized for old NextJS 2022-10-24 23:46:06 -04:00
Kapil Koju
2094727a1b Fix nextjs images.unoptimized config path name
`images.unoptimized` is no longer in `experimental` and is stable with NextJS `v12.3.0`.
https://nextjs.org/docs/api-reference/next/image#unoptimized
2022-10-24 23:09:43 -04:00
Mingzi
d875fa8dc1 Merge pull request #31 from rentziass/rentziass/update-actions-core
Update @actions/core to 1.10.0
2022-10-06 09:56:39 -07:00
Francesco Renzi
67f329fcfd Update @actions/core to 1.10.0 2022-10-06 11:08:55 +01:00
James M. Greene
2ce6d5eaa1 Merge pull request #27 from actions/fix-readme-links
Fix non-Code links in README
2022-09-26 12:01:36 -05:00
James M. Greene
bb6976f8d1 Merge branch 'main' into fix-readme-links 2022-09-26 11:00:10 -05:00
James M. Greene
f2098a32c3 Merge pull request #26 from actions/unused-deps
Clean up some unused dependencies
2022-09-26 10:59:55 -05:00
James M. Greene
7fa35a05fd Merge branch 'main' into unused-deps 2022-09-26 10:58:37 -05:00
James M. Greene
c3113876b0 Merge pull request #25 from actions/eslint-roller
Add ESLint
2022-09-26 10:52:23 -05:00
James M. Greene
af5f3c3f72 Merge branch 'main' into eslint-roller 2022-09-21 16:18:10 -05:00
James M. Greene
ad83b485e7 Merge pull request #24 from actions/i-feel-pretty
Expand Prettier usage
2022-09-21 16:17:21 -05:00
James M. Greene
a84400a87f Fix non-Code links in README 2022-09-19 10:50:02 -05:00
James M. Greene
7a0a617c8a Remove unused dependencies 2022-09-16 23:20:01 -05:00
James M. Greene
062df390be Make ESLint fail hard on semi-colon usage 2022-09-16 23:00:18 -05:00
James M. Greene
7619de7040 Simplify ESLint ignore pattern 2022-09-16 22:55:06 -05:00
James M. Greene
66e9ac3c2e Add an 'all' script and simplify 'prepare' 2022-09-16 22:54:24 -05:00
James M. Greene
4012a9fa87 Correct Actions input parameter name 2022-09-16 22:43:42 -05:00
James M. Greene
4a12ff50fb Update distributables 2022-09-16 22:41:27 -05:00
James M. Greene
a07391ec25 Don't lint during prepare 2022-09-16 22:03:34 -05:00
James M. Greene
2491ca8488 Reformat ESLint config 2022-09-16 22:03:15 -05:00
James M. Greene
875ec87ff9 Remove stray line break 2022-09-16 22:01:13 -05:00
James M. Greene
4eadc891b5 Add Actions workflow to verify lint status 2022-09-16 21:57:04 -05:00
James M. Greene
c4feb8d01e Ignore ESLint rule about condition looping condition for now 2022-09-16 21:56:47 -05:00
James M. Greene
1f9ca39237 Fix bad reference in string interpolation
Regression from https://github.com/actions/configure-pages/pull/21
2022-09-16 21:54:58 -05:00
James M. Greene
1cefe6fc7c Remove unnecessary try/catch 2022-09-16 21:50:49 -05:00
James M. Greene
25a1ec8799 Add eslint configuration and scripts 2022-09-16 21:48:52 -05:00
James M. Greene
b9c4ac6c14 Minor workflow improvements 2022-09-16 20:48:19 -05:00
James M. Greene
6e4f93b15d Add eslint dependency and plugins 2022-09-16 20:47:23 -05:00
James M. Greene
069c984c5e Let Prettier reformat all of the things 2022-09-16 20:37:18 -05:00
James M. Greene
b030b061cb Allow prettier to check more files that it's capable of handling 2022-09-16 20:35:47 -05:00
James M. Greene
45efe60937 Apply consistent spacing and use of single quotes 2022-09-11 10:23:22 -05:00
James M. Greene
35c001ded6 Dereference as 'path'
This minimizes the changes to the codebase, as well as slightly clarifying that its value may not remain the same as the 'pathname'
2022-09-11 10:23:22 -05:00
James M. Greene
27457957e6 Merge pull request #21 from AndrewLester/ssg-origin
Use GitHub Pages site origin for setting up SSG configs
2022-09-11 10:21:18 -05:00
AndrewLester
7ec0edaa8e Fix prepare output 2022-08-19 15:10:01 -05:00
AndrewLester
d48340abcd Use GitHub Pages site origin for setting up SSG configs 2022-08-19 14:33:39 -05:00
James M. Greene
f53b57ff56 Merge pull request #20 from actions/update-major-on-full-releases
Update major version only on full releases
2022-08-19 13:21:44 -05:00
James M. Greene
6d1d650751 Update major version only on full releases 2022-08-19 12:44:16 -05:00
James M. Greene
61fd3a3cc1 Merge pull request #19 from actions/no-trailing-slashes
[BREAKING] Remove the trailing slash from `base_url` and `base_path` outputs
2022-08-19 09:27:06 -05:00
James M. Greene
0ec542a837 Update distributables 2022-08-18 18:08:52 -05:00
James M. Greene
3a90973fd3 Use local module for removing trailing slash to reduce duplication 2022-08-18 18:08:30 -05:00
James M. Greene
dc5b850bfd breaking: Remove trailing slash from base_url and base_path outputs 2022-08-18 18:08:30 -05:00
James M. Greene
9a141972ca Merge pull request #18 from actions/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.8.2 to 1.9.1
2022-08-18 18:06:10 -05:00
James M. Greene
7d9bb68583 Update distributables 2022-08-18 18:04:58 -05:00
dependabot[bot]
ec022f4ae9 Bump @actions/core from 1.8.2 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.8.2 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:59:15 +00:00
James M. Greene
f71d3d08f0 Merge pull request #16 from AndrewLester/ssg-sveltekit
Add SvelteKit as an option for static_site_generator setting
2022-08-17 14:42:52 -05:00
James M. Greene
9ff7f29195 Update dist map 2022-08-17 14:41:47 -05:00
James M. Greene
9b7553ef7f Change environment variable data type to explicit string 2022-08-17 14:34:23 -05:00
AndrewLester
42451665cc Run prepare script 2022-08-10 16:28:32 -04:00
AndrewLester
adc528a6d8 Export GITHUB_PAGES env variable 2022-08-10 16:28:32 -04:00
AndrewLester
789c331a21 Support new features from #15 2022-08-10 16:28:32 -04:00
AndrewLester
ff1182a56a Add SvelteKit to action yml 2022-08-10 16:28:32 -04:00
AndrewLester
c872edcdfb Update config parser to support export default with identifier and add SvelteKit code
Co-authored-by: NatoBoram <natoboram@users.noreply.github.com>
2022-08-10 16:28:31 -04:00
James M. Greene
c61e34fb27 Merge pull request #12 from actions/better-docs
Improve a few contribution notes in the README
2022-08-10 14:19:56 -05:00
James M. Greene
a220556ffe Merge branch 'main' into better-docs 2022-08-10 14:10:38 -05:00
James M. Greene
491169de17 Revise release procedure 2022-08-10 14:10:15 -05:00
James M. Greene
f19391002a Merge pull request #17 from actions/marketplace-action-rename
Rename to include "GitHub" in "GitHub Pages" for Marketplace
2022-08-10 13:58:37 -05:00
James M. Greene
742be05113 Update action.yml 2022-08-10 12:52:41 -05:00
James M. Greene
90b7c04b80 Merge branch 'main' into better-docs 2022-08-10 10:00:39 -05:00
James M. Greene
15f519fab9 Merge pull request #15 from actions/ssg-config-file-input
Add support for specifying the SSG configuration file path
2022-08-10 09:18:00 -05:00
James M. Greene
f5b4063a62 Update distributables properly 2022-08-10 09:02:07 -05:00
James M. Greene
d06799dbbe Fix typo in dist 2022-08-10 08:57:37 -05:00
James M. Greene
fad78054b6 Fix typo in src 2022-08-10 08:56:12 -05:00
James M. Greene
64fa685553 Rebuild distributables 2022-08-09 11:23:03 -05:00
James M. Greene
891eba7f6e Update src/config-parser.js
Co-authored-by: Yoann Chaudet <yoannchaudet@github.com>
2022-08-09 11:22:14 -05:00
James M. Greene
9f6ed02477 Tweak the title and description in README 2022-08-08 11:15:41 -05:00
James M. Greene
68595d0746 Update distributables 2022-08-05 17:47:09 -05:00
James M. Greene
4f27d51853 Add support for indirect default export declarations 2022-08-05 17:44:40 -05:00
James M. Greene
1395534a78 Hoist important arrays to top-level constants 2022-08-05 17:37:00 -05:00
James M. Greene
7c3932ff89 Add support for specifying the target generator config file 2022-08-05 17:35:23 -05:00
James M. Greene
404d23c4a6 Merge pull request #13 from actions/prettier
Prettier formatting
2022-08-05 17:29:38 -05:00
James M. Greene
06406d74b2 Merge branch 'main' into prettier 2022-08-05 17:28:54 -05:00
James M. Greene
cc95980c79 Merge pull request #14 from actions/workflow-audit
Workflow audit
2022-08-05 17:28:32 -05:00
James M. Greene
4f84ed2a14 Add concurrency settings to PR-based workflows 2022-08-05 15:54:53 -05:00
James M. Greene
f19d25133d Ensure minimal permissions are explicit on all workflows 2022-08-05 15:54:15 -05:00
James M. Greene
f24e879a69 Add concurrency and permissions to workflow 2022-08-05 15:44:58 -05:00
James M. Greene
da85ca493f Update fixtures with Prettier formatting 2022-08-05 15:40:25 -05:00
James M. Greene
d949e1515f Rename Prettier config file extension for consistency 2022-08-05 15:39:17 -05:00
James M. Greene
c69bbc2c2c Fix one expected test fixture given Prettier configuration 2022-08-05 15:35:48 -05:00
James M. Greene
8441c1b1dc Improve a few contribution notes in the README 2022-08-05 15:29:09 -05:00
James M. Greene
4036d0f035 Add a workflow to verify Prettier formatting 2022-08-05 15:28:22 -05:00
James M. Greene
5c1535b807 Update all source files to match expected Prettier formatting 2022-08-05 15:26:05 -05:00
James M. Greene
e22fa7ebed Merge pull request #11 from actions/improve-action-manifest
Improve Actions manifest
2022-08-05 13:40:43 -05:00
James M. Greene
635cafe472 Use single quotes everywhere for consistency in Actions manifest 2022-08-05 13:29:15 -05:00
James M. Greene
7c6340377c Add author to Action manifest 2022-08-05 13:28:40 -05:00
James M. Greene
542786ddbc Improve and shorten description for Marketplace publication 2022-08-05 13:27:44 -05:00
James M. Greene
c4a801b850 Merge pull request #9 from actions/dist-check-workflow
Add workflow to verify distributables are built
2022-08-05 13:10:05 -05:00
James M. Greene
fcc627b194 Merge branch 'main' into dist-check-workflow 2022-08-05 13:09:06 -05:00
James M. Greene
2fc7b604aa Add explicit permissions to workflow 2022-08-05 13:08:52 -05:00
James M. Greene
bcfa2c863c Merge pull request #8 from actions/cleanup-test-workflow
Cleanup formatting of test workflow
2022-08-05 13:07:40 -05:00
James M. Greene
c95cb0d322 Merge pull request #7 from actions/pkg-metadata
Correct a few metadata field values in the `package.json`
2022-08-05 13:07:25 -05:00
James M. Greene
d2f9056bbc Merge pull request #6 from actions/optional-enablement
Make Pages enablement (and write permissions) optional
2022-08-05 13:06:58 -05:00
James M. Greene
b619d6bb2a Make certain the env var isn't present during testing 2022-08-05 12:59:28 -05:00
James M. Greene
1f779755f8 Readd distributables 2022-08-05 12:13:48 -05:00
James M. Greene
bce63914b1 Incorporate the spirit of changes from https://github.com/actions/configure-pages/pull/10 2022-08-05 12:13:23 -05:00
James M. Greene
0a94d4c3bb Merge branch 'main' into optional-enablement 2022-08-05 12:05:17 -05:00
Mingzi
d868d5fe4e Merge pull request #10 from actions/fix-hard-coded-api-endpoint
Fix hardcoded api endpoint
2022-08-05 09:55:37 -07:00
yimysty
d8dd1327a1 fix hardcoded api endpoint 2022-08-05 09:52:17 -07:00
James M. Greene
2a2b0fadb6 Remove diff of 'pre' since this Action doesn't have that directory 2022-08-03 21:47:18 -05:00
James M. Greene
e2ea66d572 Revise comment 2022-08-03 21:46:57 -05:00
James M. Greene
55225928a1 Add workflow to verify distributables are built 2022-08-03 18:30:55 -05:00
James M. Greene
62a7d4f2dc Cleanup formatting of test workflow 2022-08-03 18:30:19 -05:00
James M. Greene
929a1c7425 Correct a few metadata field values in the package.json 2022-08-03 18:24:31 -05:00
James M. Greene
17536ca11a Update organization name in tests 2022-08-03 18:19:57 -05:00
James M. Greene
d801b818b5 Update dist 2022-08-03 18:10:24 -05:00
James M. Greene
fc0fb71264 Delete old modules 2022-08-03 18:10:04 -05:00
James M. Greene
af945d6133 Update index.js to utilize new modules 2022-08-03 18:09:46 -05:00
James M. Greene
b2561d383d Add dedicated Actions-outputs module 2022-08-03 18:09:04 -05:00
James M. Greene
bb42d7b1cb Add new API client to consolidate REST API calls 2022-08-03 18:08:29 -05:00
James M. Greene
0455a16aca Allow a user to manually opt-out of Pages site enablement 2022-08-02 20:45:01 -05:00
Yoann Chaudet
677bce1797 Merge pull request #3 from actions/paper-spa-updates
Pull in latest updates
2022-07-26 11:49:12 -07:00
James M. Greene
49843a9170 Merge pull request #16 from paper-spa/latest-ecma
Update Espree configuration to allow for latest supported ECMA version
2022-07-22 18:06:07 -05:00
James M. Greene
86288138eb Fix spacing 2022-07-22 18:04:52 -05:00
James M. Greene
98aa330a29 Update Espree configuration to allow for latest supported ECMA version 2022-07-22 18:03:26 -05:00
James M. Greene
e993237306 Update dist 2022-07-22 18:02:57 -05:00
James M. Greene
1fb9ba6653 Add tests that will fail with ECMA 6 parsing 2022-07-22 18:01:42 -05:00
James M. Greene
1457a09e2b Revert to using ECMA 6 2022-07-22 18:01:23 -05:00
James M. Greene
3480141499 Update Espree configuration to allow for latest supported ECMA version 2022-07-22 14:10:25 -05:00
Yoann Chaudet
8981dbcb59 Merge pull request #15 from paper-spa/server-static 2022-07-21 08:25:59 -07:00
Yoann Chaudet
7875e4af8a target not server 2022-07-20 15:28:26 -07:00
Yoann Chaudet
844ceaff5a Do a bit more configuration for nuxt, set server = 'static' 2022-07-20 13:14:25 -07:00
Yoann Chaudet
398adf731a Merge pull request #14 from paper-spa/fallback
Rewrite the AST logic to be more complete
2022-07-20 12:53:08 -07:00
Yoann Chaudet
dddd39c6b9 Documentation 2022-07-19 17:16:40 -07:00
Yoann Chaudet
084dc5123d experimental 2022-07-19 17:15:09 -07:00
Yoann Chaudet
3d51fe705a false true 2022-07-19 17:05:37 -07:00
Yoann Chaudet
3d2f0e5994 Refactor to inject multiple properties 2022-07-19 17:03:44 -07:00
Yoann Chaudet
ad121920a0 Add blank fixtures for nuxt 2022-07-19 16:31:11 -07:00
Yoann Chaudet
53eec1a8cc fix next 2022-07-19 16:27:57 -07:00
Yoann Chaudet
69fea3d62e typo 2022-07-19 16:21:56 -07:00
Yoann Chaudet
05829a2e3d Update dist 2022-07-19 16:17:11 -07:00
Yoann Chaudet
33fad13833 Fix context: 2022-07-19 16:16:35 -07:00
Yoann Chaudet
931e155079 Add tests for config-parser 2022-07-19 16:15:25 -07:00
James M. Greene
250c4fb989 Update dist files 2022-07-19 16:54:17 -05:00
Yoann Chaudet
a774891038 update dist 2022-07-19 11:52:32 -07:00
Yoann Chaudet
5941f86157 Fix tests 2022-07-19 11:52:20 -07:00
Yoann Chaudet
8f29fe2748 Update dist 2022-07-19 11:50:09 -07:00
Yoann Chaudet
ba4576e776 Add set-pages-path tests 2022-07-19 11:48:11 -07:00
James M. Greene
43a5456c3f Fix dist after installing dependencies 2022-07-19 13:02:27 -05:00
James M. Greene
2d3e762f19 Update dist for testing 2022-07-19 12:59:37 -05:00
Yoann Chaudet
f830cbcb66 Cleanup the whole config-parser class 2022-07-18 19:13:56 -07:00
Yoann Chaudet
3efd613ed2 wip: add formatter support to the output file 2022-07-18 15:51:32 -07:00
Yoann Chaudet
cf1ab90e59 Merge pull request #13 from paper-spa/reformat-all-the-things
Add prettier configuration
2022-07-18 15:33:22 -07:00
Yoann Chaudet
e2bf7f26fb Reformat nextjs fixtures 2022-07-18 15:14:53 -07:00
Yoann Chaudet
df54bc901b Update distribution 2022-07-18 15:08:08 -07:00
Yoann Chaudet
61e591d3b5 Add prettier configuration 2022-07-18 15:06:14 -07:00
Yoann Chaudet
bfe36bc062 Merge pull request #2 from actions/release
Change release trigger
2022-07-13 15:36:34 -07:00
Yoann Chaudet
cb174c0f85 Change release trigger 2022-07-13 14:00:00 -07:00
95 changed files with 17110 additions and 8777 deletions

17
.eslintrc.json Normal file
View File

@@ -0,0 +1,17 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true,
"jest": true
},
"plugins": ["github"],
"extends": ["eslint:recommended", "prettier", "plugin:github/internal"],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"semi": ["error", "never"]
},
"ignorePatterns": ["/dist/", "/src/fixtures/", "/src/blank-configurations/"]
}

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

@@ -1,6 +1,6 @@
--- ---
name-template: "v$RESOLVED_VERSION" name-template: 'v$RESOLVED_VERSION'
tag-template: "v$RESOLVED_VERSION" tag-template: 'v$RESOLVED_VERSION'
template: | template: |
# Changelog # Changelog
@@ -8,33 +8,33 @@ template: |
See details of [all code changes](https://github.com/$OWNER/$REPOSITORY/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.
categories: categories:
- title: "🚀 Features" - title: '🚀 Features'
labels: labels:
- "feature" - 'feature'
- "enhancement" - 'enhancement'
- title: "🐛 Bug Fixes" - title: '🐛 Bug Fixes'
labels: labels:
- "fix" - 'fix'
- "bugfix" - 'bugfix'
- "bug" - 'bug'
- title: "🧰 Maintenance" - title: '🧰 Maintenance'
labels: labels:
- "infrastructure" - 'infrastructure'
- "automation" - 'automation'
- "documentation" - 'documentation'
- title: "🏎 Performance" - title: '🏎 Performance'
label: "performance" label: 'performance'
change-template: "- $TITLE @$AUTHOR (#$NUMBER)" change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver: version-resolver:
major: major:
labels: labels:
- "type: breaking" - 'type: breaking'
minor: minor:
labels: labels:
- "type: enhancement" - 'type: enhancement'
patch: patch:
labels: labels:
- "type: bug" - 'type: bug'
- "type: maintenance" - 'type: maintenance'
- "type: documentation" - 'type: documentation'
default: patch default: patch

52
.github/workflows/check-dist.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
# When you reference this Action with `uses:` in a workflow,
# `dist/index.js` is the code that will run.
# For our project, we generate this file using `ncc`.
# We need to make sure the checked-in `dist/index.js` actually matches what we expect it to be.
name: Check dist/
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
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:
check-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Rebuild the dist/ directory
run: npm run prepare
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build in dist folder. See status below:"
git diff
exit 1
fi

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

@@ -0,0 +1,35 @@
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:
test:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Verify formatting
run: npm run format: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 repository
uses: actions/checkout@v3
# 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

View File

@@ -4,11 +4,14 @@ on:
branches: branches:
- main - main
permissions:
contents: write
jobs: jobs:
draft-release: draft-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: release-drafter/release-drafter@v5 - uses: release-drafter/release-drafter@v5
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

35
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Lint code
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
timeout-minutes: 2
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint:check

View File

@@ -0,0 +1,48 @@
name: Rebuild distributables for Dependabot PRs
on:
push:
branches:
- 'dependabot/npm**'
permissions:
contents: write
# 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:
rebuild-dist:
if: ${{ github.event.sender.login == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PAGES_AUTOMATION_PAT }}
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: 16.x
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,11 +1,11 @@
name: Release name: Release
on: on:
release: release:
types: [edited] types: [released]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
TAG_NAME: TAG_NAME:
description: "Tag name that the major tag will point to" description: 'Tag name that the major tag will point to'
required: true required: true
env: env:
@@ -24,7 +24,7 @@ jobs:
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

@@ -6,20 +6,29 @@ on:
- main - main
pull_request: 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: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set Node.JS - name: Setup Node.JS
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 16.x node-version: 16.x
cache: 'npm'
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Run tests - name: Run tests
run: npm test run: npm test

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
node_modules/ node_modules/
/src/fixtures/tmp
# Editors # Editors
.vscode/ .vscode/

5
.prettierignore Normal file
View File

@@ -0,0 +1,5 @@
# Ignore build artifacts
/dist/
# Ignore all Markdown files
*.md

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

View File

@@ -1,6 +1,8 @@
# Configure-Pages # configure-pages
An action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as [starter workflows][starter-workflows]. A GitHub Action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as [starter workflows][starter-workflows].
See [`set-pages-config.js`](src/set-pages-config.js) for more details on how we configure static site generators to work "out of the box" with GitHub Pages.
# Usage # Usage
@@ -10,18 +12,13 @@ See [action.yml](action.yml) and the [Pages starter workflows][starter-workflows
In order to release a new version of this Action: In order to release a new version of this Action:
1. Locate the semantic version of the upcoming release (a draft is maintained by the [`draft-release` workflow][draft-release]) 1. Locate the semantic version of the [upcoming release][release-list] (a draft is maintained by the [`draft-release` workflow][draft-release]).
2. Push a matching tag, for instance for `v0.1.0`: 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:
```bash 3. After publishing the release, the [`release` workflow][release] will automatically run to create/update the corresponding the major version tag such as `v0`.
git tag v0.1.0
git push origin v0.1.0
```
3. Publish the draft release (the major tag such as `v0` will be created/updated by the [`release` workflow][release]) ⚠️ Environment approval is required. Check the [Release workflow run list][release-workflow-runs].
⚠️ Environment approval is required.
# License # License
@@ -29,5 +26,7 @@ The scripts and documentation in this project are released under the [MIT Licens
<!-- references --> <!-- references -->
[starter-workflows]: https://github.com/actions/starter-workflows/tree/main/pages [starter-workflows]: https://github.com/actions/starter-workflows/tree/main/pages
[release-list]: https://github.com/actions/configure-pages/releases
[draft-release]: .github/workflows/draft-release.yml [draft-release]: .github/workflows/draft-release.yml
[release]: .github/workflows/release.yml [release]: .github/workflows/release.yml
[release-workflow-runs]: https://github.com/actions/configure-pages/actions/workflows/release.yml

View File

@@ -1,22 +1,30 @@
name: "Configure Pages" name: 'Configure GitHub Pages'
description: "An action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as starter workflows." description: 'A GitHub Action to enable Pages, extract various metadata about a site, and configure some supported static site generators.'
author: 'GitHub'
runs: runs:
using: "node16" using: 'node16'
main: "dist/index.js" main: 'dist/index.js'
inputs: inputs:
static_site_generator: static_site_generator:
description: "Optional static site generator to attempt to configure (nuxt, next or gatsby)" description: 'Optional static site generator to attempt to configure: "nuxt", "next", "gatsby", or "sveltekit"'
required: false
generator_config_file:
description: 'Optional file path to static site generator configuration file'
required: false required: false
token: token:
description: "GitHub token" description: 'GitHub token'
default: ${{ github.token }} default: ${{ github.token }}
required: true required: true
enablement:
description: 'Try to enable Pages for the repository if it is not already enabled. This option requires a token other than `GITHUB_TOKEN` to be provided. In the context of a Personal Access Token, the `repo` scope or Pages write permission is required. In the context of a GitHub App, the `administration:write` and `pages:write` permissions are required.'
default: 'false'
required: false
outputs: outputs:
base_url: base_url:
description: 'GitHub Pages site full base URL. Examples: "https://octocat.github.io/my-repo/", "https://octocat.github.io/", "https://www.example.com/"' description: 'GitHub Pages site full base URL. Examples: "https://octocat.github.io/my-repo", "https://octocat.github.io", "https://www.example.com"'
origin: origin:
description: 'GitHub Pages site origin. Examples: "https://octocat.github.io", "https://www.example.com"' description: 'GitHub Pages site origin. Examples: "https://octocat.github.io", "https://www.example.com"'
host: host:
description: 'GitHub Pages site host. Examples: "octocat.github.io", "www.example.com"' description: 'GitHub Pages site host. Examples: "octocat.github.io", "www.example.com"'
base_path: base_path:
description: 'GitHub Pages site full base path. Examples: "/my-repo/" or "/"' description: 'GitHub Pages site full base path. Examples: "/my-repo" or ""'

2
dist/gatsby.js vendored Normal file
View File

@@ -0,0 +1,2 @@
// Default Pages configuration for Gatsby
module.exports = {}

14779
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

759
dist/licenses.txt vendored
View File

@@ -10,6 +10,18 @@ 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.
@actions/github
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 @actions/http-client
MIT MIT
Actions Http Client for Node.js Actions Http Client for Node.js
@@ -35,6 +47,188 @@ 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.
@octokit/auth-token
MIT
The MIT License
Copyright (c) 2019 Octokit 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.
@octokit/core
MIT
The MIT License
Copyright (c) 2019 Octokit 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.
@octokit/endpoint
MIT
The MIT License
Copyright (c) 2018 Octokit 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.
@octokit/graphql
MIT
The MIT License
Copyright (c) 2018 Octokit 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.
@octokit/plugin-paginate-rest
MIT
MIT License Copyright (c) 2019 Octokit 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 (including the next paragraph) 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/plugin-rest-endpoint-methods
MIT
MIT License Copyright (c) 2019 Octokit 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 (including the next paragraph) 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/request
MIT
The MIT License
Copyright (c) 2018 Octokit 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.
@octokit/request-error
MIT
The MIT License
Copyright (c) 2019 Octokit 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.
@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.
acorn acorn
MIT MIT
MIT License MIT License
@@ -83,122 +277,228 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
asynckit before-after-hook
MIT Apache-2.0
The MIT License (MIT) Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2016 Alex Indigo TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Permission is hereby granted, free of charge, to any person obtaining a copy 1. Definitions.
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 "License" shall mean the terms and conditions for use, reproduction,
copies or substantial portions of the Software. and distribution as defined by Sections 1 through 9 of this document.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR "Licensor" shall mean the copyright owner or entity authorized by
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, the copyright owner that is granting the License.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER "Legal Entity" shall mean the union of the acting entity and all
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, other entities that control, are controlled by, or are under common
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE control with that entity. For the purposes of this definition,
SOFTWARE. "control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2018 Gregor Martynus and other contributors.
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.
axios deprecation
MIT ISC
Copyright (c) 2014-present Matt Zabriskie The ISC License
Permission is hereby granted, free of charge, to any person obtaining a copy Copyright (c) Gregor Martynus and contributors
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 Permission to use, copy, modify, and/or distribute this software for any
all copies or substantial portions of the Software. purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
THE SOFTWARE. IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
combined-stream
MIT
Copyright (c) 2011 Debuggable Limited <felix@debuggable.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.
debug
MIT
(The MIT License)
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon
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.
delayed-stream
MIT
Copyright (c) 2011 Debuggable Limited <felix@debuggable.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.
eslint-visitor-keys eslint-visitor-keys
@@ -435,123 +735,36 @@ 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. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
follow-redirects is-plain-object
MIT MIT
Copyright 2014present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben Verborgh The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of Copyright (c) 2014-2017, Jon Schlinkert.
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 Permission is hereby granted, free of charge, to any person obtaining a copy
copies or substantial portions of the Software. 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 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 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, AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
form-data node-fetch
MIT
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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.
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.
mime-db
MIT
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015-2022 Douglas Christopher Wilson <doug@somethingdoug.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.
mime-types
MIT
(The MIT License)
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.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 MIT
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2016 Zeit, Inc. Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -572,36 +785,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
string-format
(WTFPL OR MIT)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE once
Version 2, December 2004 ISC
The ISC License
Copyright (c) 2018 David Chambers <dc@davidchambers.me> Copyright (c) Isaac Z. Schlueter and Contributors
Everyone is permitted to copy and distribute verbatim or modified Permission to use, copy, modify, and/or distribute this software for any
copies of this license document, and changing it is allowed as long purpose with or without fee is hereby granted, provided that the above
as the name is changed. copyright notice and this permission notice appear in all copies.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
0. You just DO WHAT THE FUCK YOU WANT TO. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
supports-color tr46
MIT 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 tunnel
MIT MIT
@@ -626,3 +831,87 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
universal-user-agent
ISC
# [ISC License](https://spdx.org/licenses/ISC)
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer 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.
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
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

3
dist/next.js vendored Normal file
View File

@@ -0,0 +1,3 @@
// Default Pages configuration for Next
const nextConfig = {}
module.exports = nextConfig

2
dist/nuxt.js vendored Normal file
View File

@@ -0,0 +1,2 @@
// Default Pages configuration for Nuxt
export default {}

8
dist/sveltekit.js vendored Normal file
View File

@@ -0,0 +1,8 @@
// Default Pages configuration for SvelteKit
import adapter from '@sveltejs/adapter-auto'
export default {
kit: {
adapter: adapter()
}
}

7587
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,39 @@
{ {
"private": true,
"name": "configure-pages", "name": "configure-pages",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "A GitHub Action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as starter workflows.",
"main": "src/index.js", "main": "./dist/index.js",
"scripts": { "scripts": {
"all": "npm run format && npm run lint && npm run prepare && npm run test",
"format": "prettier --write .",
"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", "prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt",
"test": "jest" "test": "jest"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/paper-spa/configure-pages.git" "url": "git+https://github.com/actions/configure-pages.git"
}, },
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/paper-spa/configure-pages/issues" "url": "https://github.com/actions/configure-pages/issues"
}, },
"homepage": "https://github.com/paper-spa/configure-pages#readme", "homepage": "https://github.com/actions/configure-pages#readme",
"dependencies": { "dependencies": {
"@actions/core": "^1.8.2", "@actions/core": "^1.10.0",
"axios": "^0.27.2", "@actions/github": "^5.1.1",
"axios-retry": "^3.2.5", "espree": "^9.5.0"
"espree": "^9.3.2",
"string-format": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.34.0", "@vercel/ncc": "^0.36.1",
"jest": "^28.1.1" "eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-github": "^4.7.0",
"jest": "^29.5.0",
"prettier": "^2.8.7"
} }
} }

78
src/api-client.js Normal file
View File

@@ -0,0 +1,78 @@
const core = require('@actions/core')
const github = require('@actions/github')
async function enablePagesSite({ githubToken }) {
const octokit = github.getOctokit(githubToken)
try {
const response = await octokit.rest.repos.createPagesSite({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
build_type: 'workflow'
})
const pageObject = response.data
return pageObject
} catch (error) {
if (error.response && error.response.status === 409) {
return null
}
throw error
}
}
async function getPagesSite({ githubToken }) {
const octokit = github.getOctokit(githubToken)
const response = await octokit.rest.repos.getPages({
owner: github.context.repo.owner,
repo: github.context.repo.repo
})
const pageObject = response.data
return pageObject
}
async function findOrCreatePagesSite({ githubToken, enablement = true }) {
let pageObject
// Try to find an existing Pages site first
try {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
if (!enablement) {
core.error(
'Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the `enablement` parameter for this action.',
error
)
throw error
}
core.warning('Get Pages site failed', error)
}
if (!pageObject && enablement) {
// Create a new Pages site if one doesn't exist
try {
pageObject = await enablePagesSite({ githubToken })
} catch (error) {
core.error('Create Pages site failed', error)
throw error
}
// This somehow implies that the Pages site was already created but initially failed to be retrieved.
// Try one more time for this extreme edge case!
if (pageObject == null) {
try {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
core.error('Get Pages site still failed', error)
throw error
}
}
}
return pageObject
}
module.exports = { findOrCreatePagesSite, enablePagesSite, getPagesSite }

199
src/api-client.test.js Normal file
View File

@@ -0,0 +1,199 @@
const core = require('@actions/core')
const apiClient = require('./api-client')
const mockGetPages = jest.fn()
const mockCreatePagesSite = jest.fn()
jest.mock('@actions/github', () => ({
context: {
repo: {
owner: 'actions',
repo: 'is-awesome'
}
},
getOctokit: () => ({
rest: {
repos: {
getPages: mockGetPages,
createPagesSite: mockCreatePagesSite
}
}
})
}))
describe('apiClient', () => {
const GITHUB_TOKEN = 'gha-token'
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
beforeEach(() => {
jest.restoreAllMocks()
jest.clearAllMocks()
jest.resetAllMocks()
// 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())
})
describe('enablePagesSite', () => {
it('makes a request to create a page', async () => {
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
const result = await apiClient.enablePagesSite({
githubToken: GITHUB_TOKEN
})
expect(result).toEqual(PAGE_OBJECT)
})
it('handles a 409 response when the page already exists', async () => {
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
// Simply assert that no error is raised
const result = await apiClient.enablePagesSite({
githubToken: GITHUB_TOKEN
})
expect(result).toBe(null)
})
it('re-raises errors on failure status codes', async () => {
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
let erred = false
try {
await apiClient.enablePagesSite({
githubToken: GITHUB_TOKEN
})
} catch (error) {
erred = true
expect(error.response.status).toEqual(404)
}
expect(erred).toBe(true)
})
})
describe('getPagesSite', () => {
it('makes a request to get a page', async () => {
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
mockGetPages.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
const result = await apiClient.getPagesSite({
githubToken: GITHUB_TOKEN
})
expect(result).toEqual(PAGE_OBJECT)
})
it('re-raises errors on failure status codes', async () => {
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
let erred = false
try {
await apiClient.getPagesSite({
githubToken: GITHUB_TOKEN
})
} catch (error) {
erred = true
expect(error.response.status).toEqual(404)
}
expect(erred).toBe(true)
})
})
describe('findOrCreatePagesSite', () => {
it('does not make a request to create a page if it already exists', async () => {
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
mockGetPages.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
const result = await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN
})
expect(result).toEqual(PAGE_OBJECT)
expect(mockGetPages).toHaveBeenCalledTimes(1)
expect(mockCreatePagesSite).toHaveBeenCalledTimes(0)
})
it('makes request to create a page by default if it does not exist', async () => {
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
const result = await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN
})
expect(result).toEqual(PAGE_OBJECT)
expect(mockGetPages).toHaveBeenCalledTimes(1)
expect(mockCreatePagesSite).toHaveBeenCalledTimes(1)
})
it('makes a request to create a page when explicitly enabled if it does not exist', async () => {
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
const result = await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN,
enablement: true
})
expect(result).toEqual(PAGE_OBJECT)
expect(mockGetPages).toHaveBeenCalledTimes(1)
expect(mockCreatePagesSite).toHaveBeenCalledTimes(1)
})
it('does not make a request to create a page when explicitly disabled even if it does not exist', async () => {
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 500 } })) // just so they both aren't 404
let erred = false
try {
await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN,
enablement: false
})
} catch (error) {
erred = true
// re-raised error
expect(error.response.status).toEqual(404)
}
expect(erred).toBe(true)
expect(mockGetPages).toHaveBeenCalledTimes(1)
expect(mockCreatePagesSite).toHaveBeenCalledTimes(0)
})
it('does not make a second request to get page if create fails for reason other than existence', async () => {
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 500 } })) // just so they both aren't 404
let erred = false
try {
await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN
})
} catch (error) {
erred = true
// re-raised error
expect(error.response.status).toEqual(500)
}
expect(erred).toBe(true)
expect(mockGetPages).toHaveBeenCalledTimes(1)
expect(mockCreatePagesSite).toHaveBeenCalledTimes(1)
})
it('makes second request to get page if create fails because of existence', async () => {
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
mockGetPages
.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
const result = await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN
})
expect(result).toEqual(PAGE_OBJECT)
expect(mockGetPages).toHaveBeenCalledTimes(2)
expect(mockCreatePagesSite).toHaveBeenCalledTimes(1)
})
})
})

View File

@@ -0,0 +1,2 @@
// Default Pages configuration for Gatsby
module.exports = {}

View File

@@ -0,0 +1,3 @@
// Default Pages configuration for Next
const nextConfig = {}
module.exports = nextConfig

View File

@@ -0,0 +1,2 @@
// Default Pages configuration for Nuxt
export default {}

View File

@@ -0,0 +1,8 @@
// Default Pages configuration for SvelteKit
import adapter from '@sveltejs/adapter-auto'
export default {
kit: {
adapter: adapter()
}
}

View File

@@ -1,156 +1,436 @@
const fs = require("fs") const fs = require('fs')
const espree = require("espree") const espree = require('espree')
const format = require("string-format")
const core = require('@actions/core') const core = require('@actions/core')
// Parse the AST /*
const espreeOptions = { Parse a JavaScript based configuration file and inject arbitrary key/value in it.
ecmaVersion: 6, This is used to make sure most static site generators can automatically handle
sourceType: "module", Pages's path based routing (and work).
range: true,
} Supported configuration initializations:
(1) Direct default export:
export default {
// configuration object here
}
(2) Direct module export:
module.exports = {
// configuration object here
}
(3) Indirect default export:
const config = {
// configuration object here
}
export default config
(4) Indirect module export:
const config = {
// configuration object here
}
module.exports = config
(5) Direct default export with wrapping call:
export default defineConfig({
// configuration object here
})
(6) Direct module export with wrapping call:
module.exports = defineConfig({
// configuration object here
})
(7) Indirect default export with wrapping call at the definition:
const config = defineConfig({
// configuration object here
})
export default config
(8) Indirect default export with wrapping call at the export:
const config = {
// configuration object here
}
export default defineConfig(config)
(9) Indirect module export with wrapping call at the definition:
const config = defineConfig({
// configuration object here
})
module.exports = config
(10) Indirect module export with wrapping call at the export:
const config = {
// configuration object here
}
module.exports = defineConfig(config)
*/
class ConfigParser { class ConfigParser {
constructor(staticSiteConfig) { // Ctor
this.pathPropertyNuxt = `router: {\n base: '{0}'\n }` // - configurationFile: path to the configuration file
this.pathPropertyNext = `basePath: '{0}'` // - blankConfigurationFile: a blank configuration file to use if non was previously found
this.pathPropertyGatsby = `pathPrefix: '{0}'` constructor({ configurationFile, blankConfigurationFile, allowWrappingCall = false, properties }) {
this.configskeleton = `export default {\n {0}\n}` // Save field
this.staticSiteConfig = staticSiteConfig this.configurationFile = configurationFile
this.config = fs.existsSync(this.staticSiteConfig.filePath) ? fs.readFileSync(this.staticSiteConfig.filePath, "utf8") : null this.allowWrappingCall = allowWrappingCall === true
this.validate() this.properties = properties
}
validate() { // If the configuration file does not exist, initialize it with the blank configuration file
if (!this.config) { if (!fs.existsSync(this.configurationFile)) {
core.info(`original raw configuration was empty:\n${this.config}`) core.info('Using default blank configuration')
core.info('Generating a default configuration to start from...') const blankConfiguration = fs.readFileSync(blankConfigurationFile, 'utf8')
fs.writeFileSync(this.configurationFile, blankConfiguration, {
// Update the `config` property with a default configuration file encoding: 'utf8'
this.config = this.generateConfigFile() })
}
}
generateConfigFile() {
switch (this.staticSiteConfig.type) {
case "nuxt":
return format(this.configskeleton, format(this.pathPropertyNuxt, this.staticSiteConfig.newPath))
break
case "next":
return format(this.configskeleton, format(this.pathPropertyNext, this.staticSiteConfig.newPath))
break
case "gatsby":
return format(this.configskeleton, format(this.pathPropertyGatsby, this.staticSiteConfig.newPath))
break
default:
throw "Unknown config type"
}
}
generateConfigProperty() {
switch (this.staticSiteConfig.type) {
case "nuxt":
return format(this.pathPropertyNuxt, this.staticSiteConfig.newPath)
break
case "next":
return format(this.pathPropertyNext, this.staticSiteConfig.newPath)
break
case "gatsby":
return format(this.pathPropertyGatsby, this.staticSiteConfig.newPath)
break
default:
throw "Unknown config type"
}
}
parse() {
core.info(`original configuration:\n${this.config}`)
const ast = espree.parse(this.config, espreeOptions);
// Find the default export declaration node
var exportNode = ast.body.find(node => node.type === 'ExpressionStatement')
if (exportNode) {
var property = this.getPropertyModuleExport(exportNode)
} else {
exportNode = ast.body.find(node => node.type === 'ExportDefaultDeclaration')
if (!exportNode) throw "Unable to find default export"
var property = this.getPropertyExportDefault(exportNode)
} }
// Read the configuration file
this.configuration = fs.readFileSync(this.configurationFile, 'utf8')
}
findTopLevelVariableDeclarator(ast, identifierName) {
let targetDeclarator
ast.body.find(
node =>
node.type === 'VariableDeclaration' &&
node.declarations &&
node.declarations.length > 0 &&
node.declarations.find(declarator => {
if (
declarator.type === 'VariableDeclarator' &&
declarator.id &&
declarator.id.type === 'Identifier' &&
declarator.id.name === identifierName
) {
targetDeclarator = declarator
return true
}
})
)
return targetDeclarator
}
// Find the configuration object in an AST.
// Look for, in order:
// - a direct default export
// - a direct default export with a wrapping call
// - an indirect default export
// - an indirect default export with a wrapping call at the definition
// - an indirect default export with a wrapping call at the export
// - a direct module export
// - a direct module export with a wrapping call
// - an indirect module export
// - an indirect module export with a wrapping call at the definition
// - an indirect module export with a wrapping call at the export
//
// Return the configuration object or null.
findConfigurationObject(ast, allowWrappingCall = false) {
// Try to find a default export
var defaultExport = ast.body.find(node => node.type === 'ExportDefaultDeclaration')
// Direct default export
if (defaultExport && defaultExport.declaration.type === 'ObjectExpression') {
core.info('Found configuration object in direct default export declaration')
return defaultExport.declaration
}
// Direct default export with a wrapping call
else if (
allowWrappingCall &&
defaultExport &&
defaultExport.declaration.type === 'CallExpression' &&
defaultExport.declaration.arguments.length > 0 &&
defaultExport.declaration.arguments[0] &&
defaultExport.declaration.arguments[0].type === 'ObjectExpression'
) {
core.info('Found configuration object in direct default export declaration with a wrapping call')
return defaultExport.declaration.arguments[0]
}
// Indirect default export
else if (defaultExport && defaultExport.declaration.type === 'Identifier') {
const identifierName = defaultExport.declaration.name
const identifierDeclarator = this.findTopLevelVariableDeclarator(ast, identifierName)
const identifierInitialization = identifierDeclarator && identifierDeclarator.init
if (identifierInitialization && identifierInitialization.type === 'ObjectExpression') {
core.info('Found configuration object in indirect default export declaration')
return identifierInitialization
}
// Indirect default export with a wrapping call at the definition
else if (
allowWrappingCall &&
identifierInitialization &&
identifierInitialization.type === 'CallExpression' &&
identifierInitialization.arguments.length > 0 &&
identifierInitialization.arguments[0] &&
identifierInitialization.arguments[0].type === 'ObjectExpression'
) {
core.info(
'Found configuration object in indirect default export declaration with a wrapping call at the definition'
)
return identifierInitialization.arguments[0]
}
}
// Indirect default export with a wrapping call at the export
else if (
allowWrappingCall &&
defaultExport &&
defaultExport.declaration.type === 'CallExpression' &&
defaultExport.declaration.arguments.length > 0 &&
defaultExport.declaration.arguments[0] &&
defaultExport.declaration.arguments[0].type === 'Identifier'
) {
const identifierName = defaultExport.declaration.arguments[0].name
const identifierDeclarator = this.findTopLevelVariableDeclarator(ast, identifierName)
const identifierInitialization = identifierDeclarator && identifierDeclarator.init
if (identifierInitialization && identifierInitialization.type === 'ObjectExpression') {
core.info(
'Found configuration object in indirect default export declaration with a wrapping call at the export'
)
return identifierInitialization
}
}
// Try to find a module export
var moduleExport = ast.body.find(
node =>
node.type === 'ExpressionStatement' &&
node.expression.type === 'AssignmentExpression' &&
node.expression.operator === '=' &&
node.expression.left.type === 'MemberExpression' &&
node.expression.left.object.type === 'Identifier' &&
node.expression.left.object.name === 'module' &&
node.expression.left.property.type === 'Identifier' &&
node.expression.left.property.name === 'exports'
)
// Direct module export
if (moduleExport && moduleExport.expression.right.type === 'ObjectExpression') {
core.info('Found configuration object in direct module export')
return moduleExport.expression.right
}
// Direct default export with a wrapping call
else if (
allowWrappingCall &&
moduleExport &&
moduleExport.expression.right.type === 'CallExpression' &&
moduleExport.expression.right.arguments.length > 0 &&
moduleExport.expression.right.arguments[0] &&
moduleExport.expression.right.arguments[0].type === 'ObjectExpression'
) {
core.info('Found configuration object in direct module export with a wrapping call')
return moduleExport.expression.right.arguments[0]
}
// Indirect module export
else if (moduleExport && moduleExport.expression.right.type === 'Identifier') {
const identifierName = moduleExport && moduleExport.expression.right.name
const identifierDeclarator = this.findTopLevelVariableDeclarator(ast, identifierName)
const identifierInitialization = identifierDeclarator && identifierDeclarator.init
if (identifierInitialization && identifierInitialization.type === 'ObjectExpression') {
core.info('Found configuration object in indirect module export')
return identifierInitialization
}
// Indirect module export with a wrapping call at the definition
else if (
allowWrappingCall &&
identifierInitialization &&
identifierInitialization.type === 'CallExpression' &&
identifierInitialization.arguments.length > 0 &&
identifierInitialization.arguments[0] &&
identifierInitialization.arguments[0].type === 'ObjectExpression'
) {
core.info('Found configuration object in indirect module export with a wrapping call at the definition')
return identifierInitialization.arguments[0]
}
}
// Indirect module export with a wrapping call at the export
else if (
allowWrappingCall &&
moduleExport &&
moduleExport.expression.right.type === 'CallExpression' &&
moduleExport.expression.right.arguments.length > 0 &&
moduleExport.expression.right.arguments[0] &&
moduleExport.expression.right.arguments[0].type === 'Identifier'
) {
const identifierName = moduleExport.expression.right.arguments[0].name
const identifierDeclarator = this.findTopLevelVariableDeclarator(ast, identifierName)
const identifierInitialization = identifierDeclarator && identifierDeclarator.init
if (identifierInitialization && identifierInitialization.type === 'ObjectExpression') {
core.info('Found configuration object in indirect module export declaration with a wrapping call at the export')
return identifierInitialization
}
}
// No configuration object found
return null
}
// Find a property with a given name on a given object.
//
// Return the matching property or null.
findProperty(object, name) {
// Try to find a property matching a given name
const property =
object.type === 'ObjectExpression' &&
object.properties.find(node => node.key.type === 'Identifier' && node.key.name === name)
// Return the property's value (if found) or null
if (property) { if (property) {
switch (this.staticSiteConfig.type) { return property.value
case "nuxt":
this.parseNuxt(property)
break
case "next":
case "gatsby":
this.parseNextGatsby(property)
break
default:
throw "Unknown config type"
}
} }
core.info(`parsed configuration:\n${this.config}`) return null
fs.writeFileSync(this.staticSiteConfig.filePath, this.config)
return this.config
} }
getPropertyModuleExport(exportNode) { // Generate a (nested) property declaration.
var propertyNode = exportNode.expression.right.properties.find( // - properties: list of properties to generate
node => node.key.type === 'Identifier' && node.key.name === this.staticSiteConfig.pathName // - startIndex: the index at which to start in the declaration
) // - propertyValue: the value of the property
//
if (!propertyNode) { // Return a nested property declaration as a string.
getPropertyDeclaration(properties, startIndex, propertyValue) {
core.info("Unable to find property, insert it : " + this.staticSiteConfig.pathName) if (startIndex === properties.length - 1) {
if (exportNode.expression.right.properties.length > 0) { return `${properties[startIndex]}: ${JSON.stringify(propertyValue)}`
this.config = this.config.slice(0, exportNode.expression.right.properties[0].range[0]) + this.generateConfigProperty() + ',\n' + this.config.slice(exportNode.expression.right.properties[0].range[0]) } else {
core.info("new config = \n" + this.config) return (
} else { `${properties[startIndex]}: {` + this.getPropertyDeclaration(properties, startIndex + 1, propertyValue) + '}'
this.config = this.config.slice(0, exportNode.expression.right.range[0] + 1) + '\n ' + this.generateConfigProperty() + '\n' + this.config.slice(exportNode.expression.right.range[1] - 1) )
core.info("new config = \n" + this.config)
}
}
return propertyNode
}
getPropertyExportDefault(exportNode) {
var propertyNode = exportNode.declaration.properties.find(
node => node.key.type === 'Identifier' && node.key.name === this.staticSiteConfig.pathName
)
if (!propertyNode) {
core.info("Unable to find property, insert it " + this.staticSiteConfig.pathName)
if (exportNode.declaration.properties.length > 0) {
this.config = this.config.slice(0, exportNode.declaration.properties[0].range[0]) + this.generateConfigProperty() + ',\n' + this.config.slice(exportNode.declaration.properties[0].range[0])
core.info("new config = \n" + this.config)
} else {
this.config = this.config.slice(0, exportNode.declaration.range[0] + 1) + '\n ' + this.generateConfigProperty() + '\n' + this.config.slice(exportNode.declaration.range[1] - 1)
core.info("new config = \n" + this.config)
}
}
return propertyNode
}
parseNuxt(propertyNode) {
// Find the base node
if (propertyNode && propertyNode.value.type === 'ObjectExpression') {
var baseNode = propertyNode.value.properties.find(node => node.key.type === 'Identifier' && node.key.name === this.staticSiteConfig.subPathName)//'base')
if (baseNode) {
// Swap the base value by a hardcoded string and print it
this.config = this.config.slice(0, baseNode.value.range[0]) + `'${this.staticSiteConfig.newPath}'` + this.config.slice(baseNode.value.range[1])
}
} }
} }
parseNextGatsby(pathNode) { // Inject all properties into the configuration
if (pathNode) { injectAll() {
this.config = this.config.slice(0, pathNode.value.range[0]) + `'${this.staticSiteConfig.newPath}'` + this.config.slice(pathNode.value.range[1]) for (var [propertyName, propertyValue] of Object.entries(this.properties)) {
this.inject(propertyName, propertyValue)
} }
} }
// Inject an arbitrary property into the configuration
// - propertyName: the name of the property (may use . to target nested objects)
// - propertyValue: the value of the property
inject(propertyName, propertyValue) {
// Logging
core.info(`Injecting property=${propertyName} and value=${propertyValue} in:`)
core.info(this.configuration)
// Parse the AST out of the configuration file
const espreeOptions = {
ecmaVersion: 'latest',
sourceType: 'module',
range: true
}
const ast = espree.parse(this.configuration, espreeOptions)
// Find the configuration object
var configurationObject = this.findConfigurationObject(ast, this.allowWrappingCall)
if (!configurationObject) {
throw 'Could not find a configuration object in the configuration file'
}
// A property may be nested in the configuration file. Split the property name with '.'
// then walk the configuration object one property at a time.
var depth = 0
const properties = propertyName.split('.')
var lastNode = configurationObject
// eslint-disable-next-line no-constant-condition
while (true) {
// Find the node for the current property
var propertyNode = this.findProperty(lastNode, properties[depth])
// Update last node
if (propertyNode != null) {
lastNode = propertyNode
depth++
}
// Exit when exiting the current configuration object
if (propertyNode == null || depth >= properties.length) {
break
}
}
// If the configuration file is defining the property we are after, update it.
if (depth == properties.length) {
// The last node identified is an object expression, so do the assignment
if (lastNode.type === 'ObjectExpression') {
this.configuration =
this.configuration.slice(0, lastNode.range[0]) +
JSON.stringify(propertyValue) +
this.configuration.slice(lastNode.range[1])
}
// A misc object was found in the configuration file (e.g. an array, a string, a boolean,
// a number, etc.), just replace the whole range by our declaration
else {
this.configuration =
this.configuration.slice(0, lastNode.range[0]) +
JSON.stringify(propertyValue) +
this.configuration.slice(lastNode.range[1])
}
}
// Create nested properties in the configuration file
else {
// Build the declaration to inject
const declaration = this.getPropertyDeclaration(properties, depth, propertyValue)
// The last node identified is an object expression, so do the assignment
if (lastNode.type === 'ObjectExpression') {
// The object is blank (no properties) so replace the whole range by a new object containing the declaration
if (lastNode.properties.length === 0) {
this.configuration =
this.configuration.slice(0, lastNode.range[0]) +
'{' +
declaration +
'}' +
this.configuration.slice(lastNode.range[1])
}
// The object contains other properties, prepend our new one at the beginning
else {
this.configuration =
this.configuration.slice(0, lastNode.properties[0].range[0]) +
declaration +
',' +
this.configuration.slice(lastNode.properties[0].range[0])
}
}
// A misc object was found in the configuration file (e.g. an array, a string, a boolean,
// a number, etc.), just replace the whole range by our declaration
else {
this.configuration =
this.configuration.slice(0, lastNode.range[0]) +
'{' +
declaration +
'}' +
this.configuration.slice(lastNode.range[1])
}
}
// Logging
core.info('Injection successful, new configuration:')
core.info(this.configuration)
// Finally write the new configuration in the file
fs.writeFileSync(this.configurationFile, this.configuration, {
encoding: 'utf8'
})
}
} }
module.exports = {ConfigParser} module.exports = { ConfigParser }

View File

@@ -1,83 +1,298 @@
const fs = require('fs')
const core = require('@actions/core')
const { ConfigParser } = require('./config-parser') const { ConfigParser } = require('./config-parser')
const fs = require("fs") const { getTempFolder, compareFiles } = require('./test-helpers')
const assert = require('assert')
const srcFolder = `${process.cwd()}/src/fixtures` // Get the temp folder
const tmpFolder = `${process.cwd()}/src/fixtures/tmp` const tempFolder = getTempFolder()
const expectedFolder = `${process.cwd()}/src/fixtures/expected`
const repoPath = "/amazing-new-repo/"
// Cases to test
const cases = [ const cases = [
["next.config.js", { //
filePath: `${tmpFolder}/next.config.js`, // Direct default export
type: "next", //
pathName: "basePath", {
newPath: repoPath property: 'property',
}], source: 'export default {}',
["next.config.old.js", { expected: 'export default { property: "value" }'
filePath: `${tmpFolder}/next.config.old.js`, },
type: "next", {
pathName: "basePath", property: 'property',
newPath: repoPath source: 'export default { property: 0 }', // property exists and is a number
}], expected: 'export default { property: "value" }'
["next.config.old.missing.js", { },
filePath: `${tmpFolder}/next.config.old.missing.js`, {
type: "next", property: 'property',
pathName: "basePath", source: 'export default { property: false }', // property exists and is a boolean
newPath: repoPath expected: 'export default { property: "value" }'
}], },
["gatsby-config.js", { {
filePath: `${tmpFolder}/gatsby-config.js`, property: 'property',
type: "gatsby", source: 'export default { property: "test" }', // property exists and is a string
pathName: "pathPrefix", expected: 'export default { property: "value" }'
newPath: repoPath },
}], {
["gatsby-config.old.js", { property: 'property',
filePath: `${tmpFolder}/gatsby-config.old.js`, source: 'export default { property: [1,2] }', // property exists and is an array
type: "gatsby", expected: 'export default { property: "value" }'
pathName: "pathPrefix", },
newPath: repoPath {
}], property: 'property',
["nuxt.config.js", { source: 'export default { property: null }', // property exists and is null
filePath:`${tmpFolder}/nuxt.config.js`, expected: 'export default { property: "value" }'
type: "nuxt", },
pathName: "router", {
subPathName: "base", property: 'property',
newPath: repoPath source: 'export default { property: { } }', // property exists and is an object
}], expected: 'export default { property: "value" }'
["nuxt.config.missing.js", { },
filePath:`${tmpFolder}/nuxt.config.missing.js`,
type: "nuxt",
pathName: "router",
subPathName: "base",
newPath: repoPath
}],
["nuxt.config.old.js", {
filePath:`${tmpFolder}/nuxt.config.old.js`,
type: "nuxt",
pathName: "router",
subPathName: "base",
newPath: repoPath
}],
];
describe('configParser', () => { // Deep properties (injection 1)
test.each(cases)( {
"%p parsed correctly", property: 'property.b.c',
(fileName, configuration) => { source: 'export default {}',
srcFileName = `${srcFolder}/${fileName}` expected: 'export default { property: { b: { c: "value" } } }'
tmpFileName = `${tmpFolder}/${fileName}` },
expectedFileName = `${expectedFolder}/${fileName}` {
fs.mkdirSync(tmpFolder, {recursive: true}) property: 'property.b.c',
fs.copyFileSync(srcFileName, tmpFileName) source: 'export default { property: 0 }', // property exists and is a number
const parser = new ConfigParser(configuration) expected: 'export default { property: { b: { c: "value" } } }'
parser.parse() },
{
property: 'property.b.c',
source: 'export default { property: { } }', // property exists and is an object
expected: 'export default { property: { b: { c: "value" } } }'
},
var expectedContent = fs.readFileSync(expectedFileName).toString() // Deep properties (injection 2)
var actualContent = fs.readFileSync(tmpFileName).toString() {
assert.equal(actualContent, expectedContent) property: 'property.b.c',
fs.rmSync(tmpFileName) source: 'export default { property: { b: 0 } }', // property exists and is a number
} expected: 'export default { property: { b: { c: "value" } } }'
) },
{
property: 'property.b.c',
source: 'export default { property: { b: { } } }', // property exists and is an object
expected: 'export default { property: { b: { c: "value" } } }'
},
{
property: 'property.b.c',
source: 'export default { property: { b: { hello: 123 } } }', // property exists and is a non-empty object
expected: 'export default { property: { b: { c: "value", hello: 123 } } }'
},
// Deep properties (existing properties)
{
property: 'a1.a2',
source: 'export default { a2: false, a1: { a3: [12] } }', // property exists and is a non-empty object
expected: 'export default { a2: false, a1: { a2: "value", a3: [12] } }'
},
//
// Indirect default export
//
{
property: 'property',
source: 'const config = {}; export default config',
expected: 'const config = { property: "value"}; export default config'
},
// with more than 1 declaration chained together
{
property: 'property',
source: 'var temp = {}, config = {}; export default config',
expected: 'var temp = {}, config = { property: "value"}; export default config'
},
// deeper
{
property: 'a.b.c',
source: 'var config = {}; export default config',
expected: 'var config = { a: { b: { c: "value" } } }; export default config'
},
{
property: 'a.b.c',
source: 'var config = { a: { b: [], c: "hello" } }; export default config',
expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; export default config'
},
//
// Direct module exports
//
{
property: 'property',
source: 'module.exports = {}',
expected: 'module.exports = { property: "value"}'
},
{
property: 'property',
source: 'module.exports = { p1: 0}',
expected: 'module.exports = { property: "value", p1: 0}'
},
{
property: 'a.b.c',
source: 'module.exports = { p1: 0}',
expected: 'module.exports = { a: { b: { c: "value" } }, p1: 0}'
},
//
// Indirect module exports
//
{
property: 'property',
source: 'const config = {}; module.exports = config',
expected: 'const config = { property: "value"}; module.exports = config'
},
// with more than 1 declaration chained together
{
property: 'property',
source: 'var temp = {}, config = {}; module.exports = config',
expected: 'var temp = {}, config = { property: "value"}; module.exports = config'
},
// deeper
{
property: 'a.b.c',
source: 'var config = {}; module.exports = config',
expected: 'var config = { a: { b: { c: "value" } } }; module.exports = config'
},
{
property: 'a.b.c',
source: 'var config = { a: { b: [], c: "hello" } }; module.exports = config',
expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; module.exports = config'
},
//
// Direct default export with wrapping call
//
{
property: 'property',
source: 'import { defineConfig } from "astro/config"; export default defineConfig({ p1: 0 })',
expected: 'import { defineConfig } from "astro/config"; export default defineConfig({ property: "value", p1: 0 })',
allowWrappingCall: true
},
//
// Direct module exports with wrapping call
//
{
property: 'property',
source: 'const { defineConfig } = require("astro/config"); module.exports = defineConfig({ p1: 0 })',
expected:
'const { defineConfig } = require("astro/config"); module.exports = defineConfig({ property: "value", p1: 0 })',
allowWrappingCall: true
},
//
// Indirect default export with wrapping call at the definition
//
{
property: 'property',
source: 'import { defineConfig } from "astro/config"; const config = defineConfig({}); export default config',
expected:
'import { defineConfig } from "astro/config"; const config = defineConfig({ property: "value" }); export default config',
allowWrappingCall: true
},
// with more than 1 declaration chained together
{
property: 'property',
source:
'import { defineConfig } from "astro/config"; const temp = {}, config = defineConfig({}); export default config',
expected:
'import { defineConfig } from "astro/config"; const temp = {}, config = defineConfig({ property: "value" }); export default config',
allowWrappingCall: true
},
//
// Indirect default export with wrapping call at the export
//
{
property: 'property',
source: 'import { defineConfig } from "astro/config"; const config = {}; export default defineConfig(config)',
expected:
'import { defineConfig } from "astro/config"; const config = { property: "value" }; export default defineConfig(config)',
allowWrappingCall: true
},
// with more than 1 declaration chained together
{
property: 'property',
source:
'import { defineConfig } from "astro/config"; const temp = {}, config = {}; export default defineConfig(config)',
expected:
'import { defineConfig } from "astro/config"; const temp = {}, config = { property: "value" }; export default defineConfig(config)',
allowWrappingCall: true
},
//
// Indirect module exports with wrapping call at the definition
//
{
property: 'property',
source:
'const { defineConfig } = require("astro/config"); const config = defineConfig({}); module.exports = config',
expected:
'const { defineConfig } = require("astro/config"); const config = defineConfig({ property: "value"}); module.exports = config',
allowWrappingCall: true
},
// with more than 1 declaration chained together
{
property: 'property',
source:
'const { defineConfig } = require("astro/config"); const temp = {}, config = defineConfig({}); module.exports = config',
expected:
'const { defineConfig } = require("astro/config"); const temp = {}, config = defineConfig({ property: "value"}); module.exports = config',
allowWrappingCall: true
},
//
// Indirect module exports with wrapping call at the export
//
{
property: 'property',
source:
'const { defineConfig } = require("astro/config"); const config = {}; module.exports = defineConfig(config)',
expected:
'const { defineConfig } = require("astro/config"); const config = { property: "value"}; module.exports = defineConfig(config)',
allowWrappingCall: true
},
// with more than 1 declaration chained together
{
property: 'property',
source:
'const { defineConfig } = require("astro/config"); const temp = {}, config = {}; module.exports = defineConfig(config)',
expected:
'const { defineConfig } = require("astro/config"); const temp = {}, config = { property: "value"}; module.exports = defineConfig(config)',
allowWrappingCall: true
}
]
describe('config-parser', () => {
beforeEach(() => {
jest.restoreAllMocks()
// Mock error/warning/info/debug to silence their output
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())
})
cases.forEach(({ property, source, expected, allowWrappingCall = false }, index) => {
it(`injects path properly for case #${index}`, () => {
// Write the source file
const sourceFile = `${tempFolder}/source.js`
fs.writeFileSync(sourceFile, source, { encoding: 'utf8' })
// Write the expected file
const expectedFile = `${tempFolder}/expected.js`
fs.writeFileSync(expectedFile, expected, { encoding: 'utf8' })
// Update the settings and do the injection
new ConfigParser({
configurationFile: sourceFile,
allowWrappingCall
}).inject(property, 'value')
// Compare the files
compareFiles(sourceFile, expectedFile)
})
})
}) })

View File

@@ -3,13 +3,15 @@ const core = require('@actions/core')
// Load variables from Actions runtime // Load variables from Actions runtime
function getRequiredVars() { function getRequiredVars() {
return { return {
repositoryNwo: process.env.GITHUB_REPOSITORY,
githubToken: core.getInput('token'), githubToken: core.getInput('token'),
staticSiteGenerator: core.getInput('static_site_generator') staticSiteGenerator: core.getInput('static_site_generator'),
generatorConfigFile: core.getInput('generator_config_file'),
enablement: core.getInput('enablement') === 'true'
} }
} }
module.exports = function getContext() { // Return the context object
function getContext() {
const requiredVars = getRequiredVars() const requiredVars = getRequiredVars()
for (const variable in requiredVars) { for (const variable in requiredVars) {
if (requiredVars[variable] === undefined) { if (requiredVars[variable] === undefined) {
@@ -19,3 +21,5 @@ module.exports = function getContext() {
core.debug('all variables are set') core.debug('all variables are set')
return requiredVars return requiredVars
} }
module.exports = { getContext }

View File

@@ -1,31 +0,0 @@
const core = require('@actions/core')
const axios = require('axios')
async function enablePages({ repositoryNwo, githubToken }) {
const pagesEndpoint = `https://api.github.com/repos/${repositoryNwo}/pages`
try {
const response = await axios.post(
pagesEndpoint,
{ build_type: 'workflow' },
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}`,
'Content-type': 'application/json',
},
}
)
core.info('Created pages site')
} catch (error) {
if (error.response && error.response.status === 409) {
core.info('Pages site exists')
return
}
core.error('Couldn\'t create pages site', error)
throw error
}
}
module.exports = enablePages

View File

@@ -1,48 +0,0 @@
const core = require('@actions/core')
const axios = require('axios')
const enablePages = require('./enable-pages')
describe('enablePages', () => {
const GITHUB_REPOSITORY = 'paper-spa/is-awesome'
const GITHUB_TOKEN = 'gha-token'
beforeEach(() => {
jest.restoreAllMocks()
// 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('makes a request to create a page', async () => {
jest
.spyOn(axios, 'post')
.mockImplementationOnce(() => Promise.resolve({ }))
await enablePages({ repositoryNwo: GITHUB_REPOSITORY, githubToken: GITHUB_TOKEN })
})
it('handles a 409 response when the page already exists', async () => {
jest
.spyOn(axios, 'post')
.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
// Simply assert that no error is raised
await enablePages({ repositoryNwo: GITHUB_REPOSITORY, githubToken: GITHUB_TOKEN })
})
it('re-raises errors on failure status codes', async () => {
jest
.spyOn(axios, 'post')
.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
try {
await enablePages({ repositoryNwo: GITHUB_REPOSITORY, githubToken: GITHUB_TOKEN })
} catch (error) {
expect(error.response.status).toEqual(404)
}
})
})

View File

@@ -1,8 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
pathPrefix: '/amazing-new-repo/',/* test */
}

View File

@@ -1,3 +0,0 @@
module.exports = {
pathPrefix: '/amazing-new-repo/'
}

View File

@@ -1,9 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
basePath: '/amazing-new-repo/'/* test */,
}

View File

@@ -1,4 +0,0 @@
module.exports={
basePath: '/amazing-new-repo/'/* test */,
}

View File

@@ -1,4 +0,0 @@
module.exports={
basePath: '/amazing-new-repo/'
}

View File

@@ -1,11 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
target: 'static',
router: {
base: '/amazing-new-repo/'
}
}

View File

@@ -1,11 +0,0 @@
import { resolve } from 'path'
export default {
router: {
base: '/amazing-new-repo/'
},
alias: {
'style': resolve(__dirname, './assets/style')
},
target: 'static'
}

View File

@@ -1,10 +0,0 @@
module.exports={
alias: {
'style': resolve(__dirname, './assets/style')
},
target: 'static',
router: {
base: '/amazing-new-repo/'
}
}

View File

@@ -1,8 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
pathPrefix: '/prefix',/* test */
}

View File

@@ -1,3 +0,0 @@
module.exports = {
pathPrefix: '/prefix'
}

View File

@@ -0,0 +1,2 @@
// Default Pages configuration for Gatsby
module.exports = { siteMetadata: { siteUrl: 'https://configure-pages.github.io' }, pathPrefix: '/docs/' }

View File

@@ -0,0 +1 @@
// This file is not read by the test suite

View File

@@ -0,0 +1,6 @@
module.exports = {
siteMetadata: {
title: 'My Gatsby Site'
},
plugins: []
}

View File

@@ -0,0 +1,8 @@
module.exports = {
pathPrefix: '/docs/',
siteMetadata: {
siteUrl: 'https://configure-pages.github.io',
title: 'My Gatsby Site'
},
plugins: []
}

View File

@@ -0,0 +1,8 @@
module.exports = {
pathPrefix: '/docs/',
siteMetadata: {
siteUrl: 'https://configure-pages.github.io',
title: 'My Gatsby Site'
},
plugins: []
}

View File

@@ -0,0 +1,8 @@
export default {
pathPrefix: '/docs/',
siteMetadata: {
siteUrl: 'https://configure-pages.github.io',
title: 'My Gatsby Site'
},
plugins: []
}

View File

@@ -0,0 +1,6 @@
module.exports = {
siteMetadata: {
title: 'My Gatsby Site'
},
plugins: []
}

View File

@@ -0,0 +1,6 @@
export default {
siteMetadata: {
title: 'My Gatsby Site'
},
plugins: []
}

View File

@@ -1,9 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
basePath: '/gh-pages-test'/* test */,
}

View File

@@ -1,4 +0,0 @@
module.exports={
basePath: '/gh-pages-test'/* test */,
}

View File

@@ -1,4 +0,0 @@
module.exports={
}

View File

@@ -0,0 +1,3 @@
// Default Pages configuration for Next
const nextConfig = { images: { unoptimized: true }, experimental: { images: { unoptimized: true } }, basePath: '/docs' }
module.exports = nextConfig

View File

@@ -0,0 +1 @@
// This file is not read by the test suite

View File

@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true
}
module.exports = nextConfig

View File

@@ -0,0 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: { unoptimized: true },
experimental: { images: { unoptimized: true } },
basePath: '/docs',
reactStrictMode: true,
swcMinify: true
}
module.exports = nextConfig

View File

@@ -0,0 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: { unoptimized: true },
experimental: { images: { unoptimized: true } },
basePath: '/docs',
reactStrictMode: true,
swcMinify: true
}
module.exports = nextConfig

View File

@@ -0,0 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: { unoptimized: true },
experimental: { images: { unoptimized: true } },
basePath: '/docs',
reactStrictMode: true,
swcMinify: true
}
export default nextConfig

View File

@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true
}
module.exports = nextConfig

View File

@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true
}
export default nextConfig

View File

@@ -1,11 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
target: 'static',
router: {
base: 'some/path'
}
}

View File

@@ -1,8 +0,0 @@
import { resolve } from 'path'
export default {
alias: {
'style': resolve(__dirname, './assets/style')
},
target: 'static'
}

View File

@@ -1,10 +0,0 @@
module.exports={
alias: {
'style': resolve(__dirname, './assets/style')
},
target: 'static',
router: {
base: 'some/path'
}
}

View File

@@ -0,0 +1,15 @@
const getAllDynamicRoute = async function () {
const routes = await (async () => {
return ['/posts/hello-world', '/posts/hello-again']
})()
return routes
}
module.exports = {
mode: 'universal',
generate: {
async routes() {
return getAllDynamicRoute()
}
}
}

View File

@@ -0,0 +1,17 @@
const getAllDynamicRoute = async function () {
const routes = await (async () => {
return ['/posts/hello-world', '/posts/hello-again']
})()
return routes
}
module.exports = {
target: 'static',
router: { base: '/docs/' },
mode: 'universal',
generate: {
async routes() {
return getAllDynamicRoute()
}
}
}

View File

@@ -0,0 +1,17 @@
const getAllDynamicRoute = async function () {
const routes = await (async () => {
return ['/posts/hello-world', '/posts/hello-again']
})()
return routes
}
export default {
target: 'static',
router: { base: '/docs/' },
mode: 'universal',
generate: {
async routes() {
return getAllDynamicRoute()
}
}
}

View File

@@ -0,0 +1,17 @@
const getAllDynamicRoute = async function () {
const routes = await (async () => {
return ['/posts/hello-world', '/posts/hello-again']
})()
return routes
}
export default {
target: 'static',
router: { base: '/docs/' },
mode: 'universal',
generate: {
async routes() {
return getAllDynamicRoute()
}
}
}

View File

@@ -0,0 +1,15 @@
const getAllDynamicRoute = async function () {
const routes = await (async () => {
return ['/posts/hello-world', '/posts/hello-again']
})()
return routes
}
export default {
mode: 'universal',
generate: {
async routes() {
return getAllDynamicRoute()
}
}
}

View File

@@ -0,0 +1,15 @@
const getAllDynamicRoute = async function () {
const routes = await (async () => {
return ['/posts/hello-world', '/posts/hello-again']
})()
return routes
}
export default {
mode: 'universal',
generate: {
async routes() {
return getAllDynamicRoute()
}
}
}

View File

@@ -0,0 +1,2 @@
// Default Pages configuration for Nuxt
export default { target: 'static', router: { base: '/docs/' } }

View File

@@ -0,0 +1 @@
// This file is not read by the test suite

View File

@@ -0,0 +1,37 @@
module.exports = {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
}

View File

@@ -0,0 +1,39 @@
module.exports = {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
target: 'static',
router: { base: '/docs/' },
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
}

View File

@@ -0,0 +1,39 @@
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
target: 'static',
router: { base: '/docs/' },
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
}

View File

@@ -0,0 +1,39 @@
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
target: 'static',
router: { base: '/docs/' },
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
}

View File

@@ -0,0 +1,37 @@
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
}

View File

@@ -0,0 +1,37 @@
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {}
}

View File

@@ -0,0 +1,10 @@
// Default Pages configuration for SvelteKit
import adapter from '@sveltejs/adapter-auto'
export default {
kit: {
prerender: { origin: 'https://configure-pages.github.io' },
paths: { base: '/docs' },
adapter: adapter()
}
}

View File

@@ -0,0 +1 @@
// This file is not read by the test suite

View File

@@ -0,0 +1,12 @@
import adapter from '@sveltejs/adapter-auto'
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
prerender: { origin: 'https://configure-pages.github.io' },
paths: { base: '/docs' },
adapter: adapter()
}
}
export default config

View File

@@ -0,0 +1,10 @@
import adapter from '@sveltejs/adapter-auto'
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter()
}
}
export default config

View File

@@ -1,37 +0,0 @@
const core = require('@actions/core')
const axios = require('axios')
const setPagesPath = require('./set-pages-path')
async function getPagesBaseUrl({ repositoryNwo, githubToken, staticSiteGenerator}) {
try {
const pagesEndpoint = `https://api.github.com/repos/${repositoryNwo}/pages`
core.info(`Get the Base URL to the page with endpoint ${pagesEndpoint}`)
const response = await axios.get(
pagesEndpoint,
{
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}`
}
}
)
pageObject = response.data
core.info(JSON.stringify(pageObject))
const siteUrl = new URL(pageObject.html_url)
if ( staticSiteGenerator ) {
setPagesPath({staticSiteGenerator, path: siteUrl.pathname})
}
core.setOutput('base_url', siteUrl.href)
core.setOutput('origin', siteUrl.origin)
core.setOutput('host', siteUrl.host)
core.setOutput('base_path', siteUrl.pathname)
} catch (error) {
core.error('Get on the Page failed', error)
throw error
}
}
module.exports = getPagesBaseUrl

View File

@@ -1,22 +1,29 @@
const core = require('@actions/core') const core = require('@actions/core')
const enablePages = require('./enable-pages')
const getPagesBaseUrl = require('./get-pages-base-url')
// All variables we need from the runtime are loaded here // All variables we need from the runtime are loaded here
const getContext = require('./context') const { getContext } = require('./context')
const { findOrCreatePagesSite } = require('./api-client')
const { setPagesConfig } = require('./set-pages-config')
const outputPagesBaseUrl = require('./output-pages-base-url')
async function main() { async function main() {
try { try {
const context = getContext() const { githubToken, enablement, staticSiteGenerator, generatorConfigFile } = getContext()
await enablePages(context)
await getPagesBaseUrl(context) const pageObject = await findOrCreatePagesSite({ githubToken, enablement })
const siteUrl = new URL(pageObject.html_url)
if (staticSiteGenerator) {
setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl })
}
outputPagesBaseUrl(siteUrl)
core.exportVariable('GITHUB_PAGES', 'true')
} catch (error) { } catch (error) {
core.setFailed(error) core.setFailed(error)
process.exit(1) process.exit(1)
} }
} }
// Main // Main
main() main()

View File

@@ -0,0 +1,15 @@
const core = require('@actions/core')
const removeTrailingSlash = require('./remove-trailing-slash')
function outputPagesBaseUrl(siteUrl) {
// Many static site generators do not want the trailing slash, and it is much easier to add than remove in a workflow
const baseUrl = removeTrailingSlash(siteUrl.href)
const basePath = removeTrailingSlash(siteUrl.pathname)
core.setOutput('base_url', baseUrl)
core.setOutput('origin', siteUrl.origin)
core.setOutput('host', siteUrl.host)
core.setOutput('base_path', basePath)
}
module.exports = outputPagesBaseUrl

View File

@@ -1,17 +1,14 @@
const core = require('@actions/core') const core = require('@actions/core')
const axios = require('axios')
//const { expect, jest } = require('@jest/globals')
const getPagesBaseUrl = require('./get-pages-base-url') const outputPagesBaseUrl = require('./output-pages-base-url')
describe('getPagesBaseUrl', () => {
const GITHUB_REPOSITORY = 'paper-spa/is-awesome'
const GITHUB_TOKEN = 'gha-token'
describe('outputPagesBaseUrl', () => {
beforeEach(() => { beforeEach(() => {
jest.restoreAllMocks() jest.restoreAllMocks()
jest.spyOn(core, 'setOutput').mockImplementation((key, value) => { key, value }) jest.spyOn(core, 'setOutput').mockImplementation((key, value) => {
key, value
})
jest.spyOn(core, 'setFailed').mockImplementation(param => param) jest.spyOn(core, 'setFailed').mockImplementation(param => param)
// Mock error/warning/info/debug // Mock error/warning/info/debug
@@ -24,45 +21,33 @@ describe('getPagesBaseUrl', () => {
it('gets expected outputs for profile site', async () => { it('gets expected outputs for profile site', async () => {
const baseUrl = 'https://octocat.github.io/' const baseUrl = 'https://octocat.github.io/'
jest outputPagesBaseUrl(new URL(baseUrl))
.spyOn(axios, 'get')
.mockImplementationOnce(() => Promise.resolve({ data: { html_url: baseUrl } }))
await getPagesBaseUrl({ repositoryNwo: GITHUB_REPOSITORY, githubToken: GITHUB_TOKEN }) expect(core.setOutput).toHaveBeenCalledWith('base_url', 'https://octocat.github.io')
expect(core.setOutput).toHaveBeenCalledWith('base_url', baseUrl)
expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://octocat.github.io') expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://octocat.github.io')
expect(core.setOutput).toHaveBeenCalledWith('host', 'octocat.github.io') expect(core.setOutput).toHaveBeenCalledWith('host', 'octocat.github.io')
expect(core.setOutput).toHaveBeenCalledWith('base_path', '/') expect(core.setOutput).toHaveBeenCalledWith('base_path', '')
}) })
it('gets expected outputs for project site', async () => { it('gets expected outputs for project site', async () => {
const baseUrl = 'https://octocat.github.io/my-repo/' const baseUrl = 'https://octocat.github.io/my-repo/'
jest outputPagesBaseUrl(new URL(baseUrl))
.spyOn(axios, 'get')
.mockImplementationOnce(() => Promise.resolve({ data: { html_url: baseUrl } }))
await getPagesBaseUrl({ repositoryNwo: GITHUB_REPOSITORY, githubToken: GITHUB_TOKEN }) expect(core.setOutput).toHaveBeenCalledWith('base_url', 'https://octocat.github.io/my-repo')
expect(core.setOutput).toHaveBeenCalledWith('base_url', baseUrl)
expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://octocat.github.io') expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://octocat.github.io')
expect(core.setOutput).toHaveBeenCalledWith('host', 'octocat.github.io') expect(core.setOutput).toHaveBeenCalledWith('host', 'octocat.github.io')
expect(core.setOutput).toHaveBeenCalledWith('base_path', '/my-repo/') expect(core.setOutput).toHaveBeenCalledWith('base_path', '/my-repo')
}) })
it('gets expected outputs for site with custom domain name', async () => { it('gets expected outputs for site with custom domain name', async () => {
const baseUrl = 'https://www.example.com/' const baseUrl = 'https://www.example.com/'
jest outputPagesBaseUrl(new URL(baseUrl))
.spyOn(axios, 'get')
.mockImplementationOnce(() => Promise.resolve({ data: { html_url: baseUrl } }))
await getPagesBaseUrl({ repositoryNwo: GITHUB_REPOSITORY, githubToken: GITHUB_TOKEN }) expect(core.setOutput).toHaveBeenCalledWith('base_url', 'https://www.example.com')
expect(core.setOutput).toHaveBeenCalledWith('base_url', baseUrl)
expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://www.example.com') expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://www.example.com')
expect(core.setOutput).toHaveBeenCalledWith('host', 'www.example.com') expect(core.setOutput).toHaveBeenCalledWith('host', 'www.example.com')
expect(core.setOutput).toHaveBeenCalledWith('base_path', '/') expect(core.setOutput).toHaveBeenCalledWith('base_path', '')
}) })
}) })

View File

@@ -0,0 +1,3 @@
module.exports = function removeTrailingSlash(str) {
return str.endsWith('/') ? str.slice(0, -1) : str
}

100
src/set-pages-config.js Normal file
View File

@@ -0,0 +1,100 @@
const core = require('@actions/core')
const { ConfigParser } = require('./config-parser')
const removeTrailingSlash = require('./remove-trailing-slash')
const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs']
// Return the settings to be passed to a {ConfigParser} for a given static site generator,
// optional configuration file path, and a Pages siteUrl value to inject
function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
let { pathname: path, origin } = siteUrl
switch (staticSiteGenerator) {
case 'nuxt':
return {
configurationFile: generatorConfigFile || './nuxt.config.js',
blankConfigurationFile: `${__dirname}/blank-configurations/nuxt.js`,
properties: {
// Configure a base path on the router
'router.base': path,
// Set the target to static too
// https://nuxtjs.org/docs/configuration-glossary/configuration-target/
target: 'static'
}
}
case 'next':
// Next does not want a trailing slash
path = removeTrailingSlash(path)
return {
configurationFile: generatorConfigFile || './next.config.js',
blankConfigurationFile: `${__dirname}/blank-configurations/next.js`,
properties: {
// Configure a base path
basePath: path,
// Disable server side image optimization too
// https://nextjs.org/docs/api-reference/next/image#unoptimized
'experimental.images.unoptimized': true,
// No longer experimental as of Next.js v12.3.0
'images.unoptimized': true
}
}
case 'gatsby':
return {
configurationFile: generatorConfigFile || './gatsby-config.js',
blankConfigurationFile: `${__dirname}/blank-configurations/gatsby.js`,
properties: {
// Configure a path prefix
pathPrefix: path,
// Configure a site url
'siteMetadata.siteUrl': origin
}
}
case 'sveltekit':
// SvelteKit does not want a trailing slash
path = removeTrailingSlash(path)
return {
configurationFile: generatorConfigFile || './svelte.config.js',
blankConfigurationFile: `${__dirname}/blank-configurations/sveltekit.js`,
properties: {
// Configure a base path
'kit.paths.base': path,
// Configure a prerender origin
'kit.prerender.origin': origin
}
}
default:
throw `Unsupported static site generator: ${staticSiteGenerator}`
}
}
// Inject Pages configuration in a given static site generator's configuration file
function setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
try {
// Parse the configuration file and try to inject the Pages configuration in it
const settings = getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl })
new ConfigParser(settings).injectAll()
} catch (error) {
const isSupportedFileExtension = SUPPORTED_FILE_EXTENSIONS.some(ext => generatorConfigFile.endsWith(ext))
// Logging
if (!isSupportedFileExtension) {
core.warning(
`Unsupported configuration file extension. Currently supported extensions: ${SUPPORTED_FILE_EXTENSIONS.map(
ext => JSON.stringify(ext)
).join(', ')}`,
error
)
} else {
core.warning(
`We were unable to determine how to inject the site metadata into your config. Generated URLs may be incorrect. The base URL for this site should be ${siteUrl}. Please ensure your framework is configured to generate relative links appropriately.`,
error
)
}
}
}
module.exports = { getConfigParserSettings, setPagesConfig }

View File

@@ -0,0 +1,111 @@
const fs = require('fs')
const path = require('path')
const core = require('@actions/core')
const { setPagesConfig } = require('./set-pages-config')
const { getTempFolder, compareFiles } = require('./test-helpers')
// Get the temp folder
const tempFolder = getTempFolder()
const SUPPORTED_GENERATORS = ['next', 'nuxt', 'gatsby', 'sveltekit']
const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs']
const IS_BLANK_CONFIG_FILE_REGEX = new RegExp(
'^blank\\.(' + SUPPORTED_FILE_EXTENSIONS.map(ext => ext.slice(1)).join('|') + ')$'
)
function isBlankConfigFileName(fileName) {
return IS_BLANK_CONFIG_FILE_REGEX.test(fileName)
}
// Test suite
describe('configParser', () => {
beforeEach(() => {
jest.restoreAllMocks()
// Mock error/warning/info/debug to silence their output
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())
})
// Iterate over the static site generators
SUPPORTED_GENERATORS.forEach(staticSiteGenerator => {
// Folder containing the fixtures for a given static site generator
const fixtureFolder = `${__dirname}/fixtures/${staticSiteGenerator}`
// Get fixture files, excluding expected results
const configurationFiles = fs.readdirSync(fixtureFolder).filter(filename => !filename.includes('.expected.'))
// Create test siteUrl
const siteUrl = new URL('https://configure-pages.github.io/docs/')
// Iterate over the fixtures, outputting to default configuration file path
const defaultFileExtension = '.js'
configurationFiles
.filter(filename => filename.endsWith(defaultFileExtension))
.forEach(configurationFile => {
it(`injects path properly for ${staticSiteGenerator} in ${configurationFile} to default configuration file`, async () => {
// Copy the source fixture to a temp file
const fixtureSourceFile = `${fixtureFolder}/${configurationFile}`
const fixtureTargetFile = `${tempFolder}/${configurationFile}`
if (!isBlankConfigFileName(configurationFile)) {
fs.copyFileSync(fixtureSourceFile, fixtureTargetFile)
} else if (fs.existsSync(fixtureTargetFile)) {
fs.rmSync(fixtureTargetFile)
}
// Do the injections for the static site generator
setPagesConfig({
staticSiteGenerator,
generatorConfigFile: fixtureTargetFile,
siteUrl
})
// Read the expected file
const expectedFile = `${fixtureFolder}/${path.basename(
configurationFile,
defaultFileExtension
)}.expected${defaultFileExtension}`
// Compare the actual and expected files
compareFiles(fixtureTargetFile, expectedFile)
})
})
SUPPORTED_FILE_EXTENSIONS.forEach(fileExtension => {
// Iterate over the fixtures, outputting to specified configuration file path
configurationFiles
.filter(filename => filename.endsWith(fileExtension))
.forEach(configurationFile => {
it(`injects path properly for ${staticSiteGenerator} in ${configurationFile} to specified *${fileExtension} configuration file`, async () => {
// Copy the source fixture to a temp file
const fixtureSourceFile = `${fixtureFolder}/${configurationFile}`
const fixtureTargetFile = `${tempFolder}/${configurationFile}`
if (!isBlankConfigFileName(configurationFile)) {
fs.copyFileSync(fixtureSourceFile, fixtureTargetFile)
} else if (fs.existsSync(fixtureTargetFile)) {
fs.rmSync(fixtureTargetFile)
}
// Do the injections for the static site generator
setPagesConfig({
staticSiteGenerator,
generatorConfigFile: fixtureTargetFile,
siteUrl
})
// Read the expected file
const expectedFile = `${fixtureFolder}/${path.basename(
configurationFile,
fileExtension
)}.expected${fileExtension}`
// Compare the actual and expected files
compareFiles(fixtureTargetFile, expectedFile)
})
})
})
})
})

View File

@@ -1,46 +0,0 @@
const core = require('@actions/core')
const axios = require('axios')
const { ConfigParser } = require('./config-parser')
async function setPagesPath({staticSiteGenerator, path}) {
try {
switch(staticSiteGenerator)
{
case 'nuxt':
var ssConfig = {
filePath:"./nuxt.config.js",
type: "nuxt",
pathName: "router",
subPathName: "base",
newPath: path
}
break;
case 'next':
var ssConfig = {
filePath:"./next.config.js",
type: "next",
pathName: "basePath",
newPath: path
}
break;
case 'gatsby':
var ssConfig = {
filePath: "./gatsby-config.js",
type: "gatsby",
pathName: "pathPrefix",
newPath: path
}
break;
default:
throw "Unknown config type"
}
let configParser = new ConfigParser(ssConfig)
configParser.parse()
} catch (error) {
core.warning(`We were unable to determine how to inject the site metadata into your config. Generated URLs may be incorrect. The base URL for this site should be ${path}. Please ensure your framework is configured to generate relative links appropriately.`, error)
}
}
module.exports = setPagesPath

39
src/test-helpers.js Normal file
View File

@@ -0,0 +1,39 @@
const fs = require('fs')
const prettier = require('prettier')
const assert = require('assert')
// Create and return the path to a temp folder
function getTempFolder() {
const tmpFolder = `${__dirname}/fixtures/tmp`
if (!fs.existsSync(tmpFolder)) {
fs.mkdirSync(tmpFolder, { recursive: true })
}
return tmpFolder
}
// Read a JavaScript file and return it formatted
function formatFile(file) {
const fileContent = fs.readFileSync(file, 'utf8')
return prettier
.format(fileContent, {
parser: 'espree',
// Prettier options
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
trailingComma: 'none',
bracketSpacing: true,
arrowParens: 'avoid'
})
.trim()
}
// Compare two JavaScript files
function compareFiles(actualFile, expectedFile) {
assert.equal(formatFile(actualFile), formatFile(expectedFile))
}
module.exports = { getTempFolder, formatFile, compareFiles }