58 Commits
v4 ... main

Author SHA1 Message Date
Joel Ambass
d5606572c4 Merge pull request #165 from actions/Jcambass-patch-1
Upgrade IA Publish
2024-10-03 11:03:54 +02:00
Joel Ambass
35e0ac4e40 Upgrade IA Publish 2024-09-16 17:22:15 +02:00
Joel Ambass
1dfbcbff65 Merge pull request #163 from actions/Jcambass-patch-1
Add workflow file for publishing releases to immutable action package
2024-09-12 17:20:06 +02:00
Joel Ambass
2f4f988792 Add workflow file for publishing releases to immutable action package
This workflow file publishes new action releases to the immutable action package of the same name as this repo.

This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
2024-09-12 15:45:52 +02:00
Mingzi
0d7570ca87 Merge pull request #162 from actions/pin-draft-release-verssion
pin draft release version
2024-09-06 14:38:55 -07:00
Mingzi Yi
3ea19669a5 pin draft release version 2024-09-06 14:34:37 -07:00
Yoann Chaudet
aabcbc432d Merge pull request #160 from actions/dependabot/npm_and_yarn/espree-10.1.0
Bump espree from 9.6.1 to 10.1.0
2024-08-11 19:08:40 -07:00
Yoann Chaudet
0b64e3413e Merge branch 'main' into dependabot/npm_and_yarn/espree-10.1.0 2024-07-18 10:33:33 -07:00
Yoann Chaudet
dc1038695c Merge pull request #143 from actions/dependabot/npm_and_yarn/eslint-config-prettier-9.1.0
Bump eslint-config-prettier from 8.8.0 to 9.1.0
2024-07-18 10:33:16 -07:00
github-actions[bot]
dd21a8346d [dependabot skip] Update distributables after Dependabot 🤖 2024-07-18 16:57:04 +00:00
dependabot[bot]
a530a34c2e Bump espree from 9.6.1 to 10.1.0
Bumps [espree](https://github.com/eslint/espree) from 9.6.1 to 10.1.0.
- [Release notes](https://github.com/eslint/espree/releases)
- [Changelog](https://github.com/eslint/espree/blob/v10.1.0/CHANGELOG.md)
- [Commits](https://github.com/eslint/espree/compare/v9.6.1...v10.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-18 16:56:37 +00:00
dependabot[bot]
d624ed25e2 Bump eslint-config-prettier from 8.8.0 to 9.1.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.8.0 to 9.1.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.8.0...v9.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-18 16:56:36 +00:00
Yoann Chaudet
577583143f Merge pull request #158 from actions/dependabot-friendly
Be more friendly to Dependabot
2024-07-18 09:55:17 -07:00
Yoann Chaudet
0c410175d2 Merge branch 'main' into dependabot-friendly 2024-07-18 09:53:53 -07:00
Yoann Chaudet
fda53c8981 Merge pull request #154 from actions/dependabot/npm_and_yarn/eslint-plugin-github-5.0.1
Bump eslint-plugin-github from 4.10.2 to 5.0.1
2024-07-18 09:47:59 -07:00
Yoann Chaudet
4374381e41 Merge branch 'main' into dependabot/npm_and_yarn/eslint-plugin-github-5.0.1 2024-07-18 09:47:17 -07:00
Yoann Chaudet
01f6e1ea62 Be more friendly to Dependabot 2024-07-17 18:57:56 -07:00
Yoann Chaudet
b7a5f35d29 Merge pull request #156 from actions/dependabot/npm_and_yarn/npm_and_yarn-5134b82be1
Bump braces from 3.0.2 to 3.0.3 in the npm_and_yarn group
2024-07-17 18:56:06 -07:00
dependabot[bot]
c3ccc393c9 Bump braces from 3.0.2 to 3.0.3 in the npm_and_yarn group
Bumps the npm_and_yarn group with 1 update: [braces](https://github.com/micromatch/braces).


Updates `braces` from 3.0.2 to 3.0.3
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 10:01:44 +00:00
dependabot[bot]
197d7ac03c Bump eslint-plugin-github from 4.10.2 to 5.0.1
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.10.2 to 5.0.1.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.10.2...v5.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 10:26:04 +00:00
James M. Greene
e1bedb3777 Merge pull request #145 from actions/dependabot/npm_and_yarn/undici-5.28.4
Bump undici from 5.28.3 to 5.28.4
2024-05-01 21:37:38 -05:00
github-actions[bot]
c872373d57 Update distributables after Dependabot 🤖 2024-04-04 17:31:55 +00:00
dependabot[bot]
34b0311f68 Bump undici from 5.28.3 to 5.28.4
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 17:31:30 +00:00
James M. Greene
983d7736d9 Merge pull request #139 from actions/config-auto-detect
Attempt to auto-detect configuration files with varying file extensions
2024-03-29 19:48:14 -05:00
James M. Greene
9cf6e24f74 Tweak comment 2024-03-28 21:19:37 -05:00
James M. Greene
f304bd89be Update distributables 2024-03-28 21:08:52 -05:00
James M. Greene
215cd51eb0 Attempt to detect existing config files matching the expected basename plus one of the supported file extensions 2024-03-28 21:08:38 -05:00
James M. Greene
e9382ac9ad Front-load the file extension warning 2024-03-28 21:07:48 -05:00
James M. Greene
7781abd34b Merge pull request #138 from actions/error-utils
Convert errors into Actions-compatible logging with annotations
2024-03-28 15:01:39 -05:00
James M. Greene
fc47e3c838 Update distributables 2024-03-28 14:55:48 -05:00
James M. Greene
9c9f8a266f Update tests to use the Octokit RequestError class 2024-03-28 14:55:36 -05:00
James M. Greene
9a4705d653 Update distributables 2024-03-28 13:49:58 -05:00
James M. Greene
f6ded38287 Fix syntax error and formatting 2024-03-28 13:49:50 -05:00
James M. Greene
b974ee5c49 Use error-utils to add error metadata to Actions workflow run annotations 2024-03-27 22:35:54 -05:00
James M. Greene
1c5932fc39 Add error-utils helper and tests 2024-03-27 22:35:12 -05:00
James M. Greene
b85f2a60ec Merge pull request #123 from actions/dependabot/npm_and_yarn/actions/github-6.0.0
Bump @actions/github from 5.1.1 to 6.0.0
2024-03-27 16:07:45 -05:00
github-actions[bot]
d14bd2c02d Update distributables after Dependabot 🤖 2024-03-27 21:05:26 +00:00
dependabot[bot]
2a4661c528 Bump @actions/github from 5.1.1 to 6.0.0
Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 5.1.1 to 6.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-27 21:05:00 +00:00
James M. Greene
ec1a48e993 Merge pull request #136 from actions/dependabot/npm_and_yarn/non-breaking-changes-23d6510b5b
Bump the non-breaking-changes group with 2 updates
2024-03-27 15:53:44 -05:00
dependabot[bot]
47ae4dc929 Bump the non-breaking-changes group with 2 updates
Bumps the non-breaking-changes group with 2 updates: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-github](https://github.com/github/eslint-plugin-github).


Updates `eslint` from 8.56.0 to 8.57.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.56.0...v8.57.0)

Updates `eslint-plugin-github` from 4.10.1 to 4.10.2
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.10.1...v4.10.2)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking-changes
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking-changes
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-27 20:38:37 +00:00
James M. Greene
a80ba3c251 Merge pull request #137 from actions/next-14
Update the Next.js configuration for v14
2024-03-27 15:36:43 -05:00
James M. Greene
150fac6047 Update the Next.js configuration for v14 2024-03-27 14:48:01 -05:00
Yoann Chaudet
b490f538fb Merge pull request #132 from actions/dependabot/npm_and_yarn/non-breaking-changes-df86ffd85c
Bump the non-breaking-changes group with 3 updates
2024-02-23 12:05:31 -08:00
Yoann Chaudet
91c6f66f8c Merge branch 'main' into dependabot/npm_and_yarn/non-breaking-changes-df86ffd85c 2024-02-23 12:04:54 -08:00
Yoann Chaudet
1d58abcaf6 Merge pull request #133 from actions/dependabot/github_actions/release-drafter/release-drafter-6
Bump release-drafter/release-drafter from 5 to 6
2024-02-12 11:39:22 -08:00
dependabot[bot]
80035486b6 Bump release-drafter/release-drafter from 5 to 6
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 10:51:38 +00:00
James M. Greene
15fac61a41 Merge pull request #127 from actions/dependabot/github_actions/github/codeql-action-3
Bump github/codeql-action from 2 to 3
2024-02-07 00:05:26 -06:00
dependabot[bot]
e4a9b007f8 Bump github/codeql-action from 2 to 3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 06:04:07 +00:00
James M. Greene
c0843f47a2 Merge pull request #120 from actions/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2024-02-07 00:02:43 -06:00
dependabot[bot]
0ac25789ae Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 06:02:14 +00:00
James M. Greene
53931f9905 Merge pull request #118 from actions/dependabot/github_actions/actions/setup-node-4
Bump actions/setup-node from 3 to 4
2024-02-07 00:01:18 -06:00
dependabot[bot]
6e9d0f5c03 Bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-07 06:00:05 +00:00
James M. Greene
649f50cc18 Merge pull request #131 from actions/dependabot/github_actions/non-breaking-changes-e893b3f303
Bump the non-breaking-changes group with 1 update
2024-02-06 23:57:24 -06:00
github-actions[bot]
448d4dc137 Update distributables after Dependabot 🤖 2024-01-31 17:28:00 +00:00
dependabot[bot]
5391e9cec8 Bump the non-breaking-changes group with 3 updates
Bumps the non-breaking-changes group with 3 updates: [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core), [@vercel/ncc](https://github.com/vercel/ncc) and [eslint](https://github.com/eslint/eslint).


Updates `@actions/core` from 1.10.0 to 1.10.1
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Updates `@vercel/ncc` from 0.36.1 to 0.38.1
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.36.1...0.38.1)

Updates `eslint` from 8.40.0 to 8.56.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.40.0...v8.56.0)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-breaking-changes
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking-changes
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking-changes
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 17:27:33 +00:00
dependabot[bot]
7532334a8e Bump the non-breaking-changes group with 1 update
Bumps the non-breaking-changes group with 1 update: [actions/publish-action](https://github.com/actions/publish-action).


Updates `actions/publish-action` from 0.2.2 to 0.3.0
- [Commits](https://github.com/actions/publish-action/compare/v0.2.2...v0.3.0)

---
updated-dependencies:
- dependency-name: actions/publish-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-breaking-changes
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 17:27:32 +00:00
James M. Greene
8f0d84851b Merge pull request #130 from actions/dependabot-grouping
Update Dependabot config to group non-breaking changes
2024-01-31 11:26:27 -06:00
James M. Greene
02a1839bae Update Dependabot config to group non-breaking changes 2024-01-31 00:34:15 -06:00
24 changed files with 28439 additions and 6413 deletions

View File

@@ -4,8 +4,14 @@ updates:
directory: '/'
schedule:
interval: 'weekly'
groups:
non-breaking-changes:
update-types: [minor, patch]
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
groups:
non-breaking-changes:
update-types: [minor, patch]

View File

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

View File

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

View File

@@ -38,11 +38,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
# 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
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

View File

@@ -11,7 +11,7 @@ jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: release-drafter/release-drafter@v5
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -20,10 +20,10 @@ jobs:
timeout-minutes: 2
steps:
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: npm

View File

@@ -0,0 +1,20 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.PAGES_AUTOMATION_PAT }}
- name: Setup Node.JS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
@@ -42,7 +42,7 @@ jobs:
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 🤖"
git commit -m "[dependabot skip] Update distributables after Dependabot 🤖"
echo "Pushing branch ${{ github.ref_name }}"
git push origin ${{ github.ref_name }}
fi

View File

@@ -24,7 +24,7 @@ jobs:
steps:
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.2.2
uses: actions/publish-action@v0.3.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

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

33212
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

194
dist/licenses.txt vendored
View File

@@ -47,6 +47,28 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
@octokit/auth-token
MIT
The MIT License
@@ -219,16 +241,6 @@ 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
MIT
MIT License
@@ -501,6 +513,29 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
error-stack-parser
MIT
Copyright (c) 2017 Eric Wendelin 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.
eslint-visitor-keys
Apache-2.0
Apache License
@@ -735,57 +770,6 @@ 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.
is-plain-object
MIT
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
node-fetch
MIT
The MIT License (MIT)
Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
once
ISC
The ISC License
@@ -805,8 +789,28 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tr46
stackframe
MIT
Copyright (c) 2017 Eric Wendelin 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.
tunnel
MIT
@@ -833,6 +837,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
undici
MIT
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
universal-user-agent
ISC
# [ISC License](https://spdx.org/licenses/ISC)
@@ -857,47 +886,6 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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

1190
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,15 +24,17 @@
},
"homepage": "https://github.com/actions/configure-pages#readme",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"espree": "^9.6.1"
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"error-stack-parser": "^2.1.4",
"espree": "^10.1.0"
},
"devDependencies": {
"@vercel/ncc": "^0.36.1",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-github": "^4.10.1",
"@octokit/request-error": "^5.0.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-github": "^5.0.1",
"jest": "^29.7.0",
"prettier": "^2.8.7"
}

View File

@@ -1,5 +1,6 @@
const core = require('@actions/core')
const github = require('@actions/github')
const { convertErrorToAnnotationProperties } = require('./error-utils')
async function enablePagesSite({ githubToken }) {
const octokit = github.getOctokit(githubToken)
@@ -43,12 +44,12 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
} 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
`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: ${error.message}`,
convertErrorToAnnotationProperties(error)
)
throw error
}
core.warning('Get Pages site failed', error)
core.warning(`Get Pages site failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
}
if (!pageObject && enablement) {
@@ -56,7 +57,7 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
try {
pageObject = await enablePagesSite({ githubToken })
} catch (error) {
core.error('Create Pages site failed', error)
core.error(`Create Pages site failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
throw error
}
@@ -66,7 +67,7 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
try {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
core.error('Get Pages site still failed', error)
core.error(`Get Pages site still failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
throw error
}
}

View File

@@ -1,9 +1,24 @@
const core = require('@actions/core')
const apiClient = require('./api-client')
const { RequestError } = require('@octokit/request-error')
const mockGetPages = jest.fn()
const mockCreatePagesSite = jest.fn()
const generateRequestError = statusCode => {
const fakeRequest = { headers: {}, url: '/' }
const fakeResponse = { status: statusCode }
let message = 'Oops'
if (statusCode === 404) {
message = 'Not Found'
}
if (statusCode === 409) {
message = 'Too Busy'
}
const error = new RequestError(message, statusCode, { request: fakeRequest, response: fakeResponse })
return error
}
jest.mock('@actions/github', () => ({
context: {
repo: {
@@ -48,7 +63,7 @@ describe('apiClient', () => {
})
it('handles a 409 response when the page already exists', async () => {
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject(generateRequestError(409)))
// Simply assert that no error is raised
const result = await apiClient.enablePagesSite({
@@ -59,7 +74,7 @@ describe('apiClient', () => {
})
it('re-raises errors on failure status codes', async () => {
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
let erred = false
try {
@@ -86,7 +101,7 @@ describe('apiClient', () => {
})
it('re-raises errors on failure status codes', async () => {
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
mockGetPages.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
let erred = false
try {
@@ -105,7 +120,7 @@ describe('apiClient', () => {
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 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
const result = await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN
@@ -117,7 +132,7 @@ describe('apiClient', () => {
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 } }))
mockGetPages.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
const result = await apiClient.findOrCreatePagesSite({
@@ -130,7 +145,7 @@ describe('apiClient', () => {
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 } }))
mockGetPages.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
const result = await apiClient.findOrCreatePagesSite({
@@ -143,8 +158,8 @@ describe('apiClient', () => {
})
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
mockGetPages.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject(generateRequestError(500))) // just so they both aren't 404
let erred = false
try {
@@ -163,8 +178,8 @@ describe('apiClient', () => {
})
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
mockGetPages.mockImplementationOnce(() => Promise.reject(generateRequestError(404)))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject(generateRequestError(500))) // just so they both aren't 404
let erred = false
try {
@@ -184,9 +199,9 @@ describe('apiClient', () => {
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.reject(generateRequestError(404)))
.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject(generateRequestError(409)))
const result = await apiClient.findOrCreatePagesSite({
githubToken: GITHUB_TOKEN

24
src/error-utils.js Normal file
View File

@@ -0,0 +1,24 @@
const ErrorStackParser = require('error-stack-parser')
// Convert an Error's stack into `@actions/core` toolkit AnnotationProperties:
// https://github.com/actions/toolkit/blob/ef77c9d60bdb03700d7758b0d04b88446e72a896/packages/core/src/core.ts#L36-L71
function convertErrorToAnnotationProperties(error, title = error.name) {
if (!(error instanceof Error)) {
throw new TypeError('error must be an instance of Error')
}
const stack = ErrorStackParser.parse(error)
const firstFrame = stack && stack.length > 0 ? stack[0] : null
if (!firstFrame) {
throw new Error('Error stack is empty or unparseable')
}
return {
title,
file: firstFrame.fileName,
startLine: firstFrame.lineNumber,
startColumn: firstFrame.columnNumber
}
}
module.exports = { convertErrorToAnnotationProperties }

38
src/error-utils.test.js Normal file
View File

@@ -0,0 +1,38 @@
const { convertErrorToAnnotationProperties } = require('./error-utils')
describe('error-utils', () => {
describe('convertErrorToAnnotationProperties', () => {
it('throws a TypeError if the first argument is not an Error instance', () => {
expect(() => convertErrorToAnnotationProperties('not an Error')).toThrow(
TypeError,
'error must be an instance of Error'
)
})
it('throws an Error if the first argument is an Error instance without a parseable stack', () => {
const error = new Error('Test error')
error.stack = ''
expect(() => convertErrorToAnnotationProperties(error)).toThrow(Error, 'Error stack is empty or unparseable')
})
it('returns an AnnotationProperties-compatible object', () => {
const result = convertErrorToAnnotationProperties(new TypeError('Test error'))
expect(result).toEqual({
title: 'TypeError',
file: __filename,
startLine: expect.any(Number),
startColumn: expect.any(Number)
})
})
it('returns an AnnotationProperties-compatible object with a custom title', () => {
const result = convertErrorToAnnotationProperties(new TypeError('Test error'), 'custom title')
expect(result).toEqual({
title: 'custom title',
file: __filename,
startLine: expect.any(Number),
startColumn: expect.any(Number)
})
})
})
})

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,9 +1,22 @@
const fs = require('fs')
const core = require('@actions/core')
const { ConfigParser } = require('./config-parser')
const removeTrailingSlash = require('./remove-trailing-slash')
const { convertErrorToAnnotationProperties } = require('./error-utils')
const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs']
function detectOrDefaultConfigFile(fileBaseName, defaultExt = '.js') {
for (const ext of SUPPORTED_FILE_EXTENSIONS) {
const potentialConfigFile = `./${fileBaseName}${ext}`
if (fs.existsSync(potentialConfigFile)) {
return potentialConfigFile
}
}
// If none of them exist yet, fall back to returning the filename with the defaultExt extension
return `./${fileBaseName}${defaultExt}`
}
// 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 }) {
@@ -12,7 +25,7 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
switch (staticSiteGenerator) {
case 'nuxt':
return {
configurationFile: generatorConfigFile || './nuxt.config.js',
configurationFile: generatorConfigFile || detectOrDefaultConfigFile('nuxt.config'),
blankConfigurationFile: `${__dirname}/blank-configurations/nuxt.js`,
properties: {
// Configure a base path on the router
@@ -28,22 +41,25 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
path = removeTrailingSlash(path)
return {
configurationFile: generatorConfigFile || './next.config.js',
configurationFile: generatorConfigFile || detectOrDefaultConfigFile('next.config'),
blankConfigurationFile: `${__dirname}/blank-configurations/next.js`,
properties: {
// Static export
// https://nextjs.org/docs/app/building-your-application/deploying/static-exports#version-history
output: 'export',
// Configure a base path
// https://nextjs.org/docs/app/api-reference/next-config-js/basePath
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',
configurationFile: generatorConfigFile || detectOrDefaultConfigFile('gatsby-config'),
blankConfigurationFile: `${__dirname}/blank-configurations/gatsby.js`,
properties: {
// Configure a path prefix
@@ -57,7 +73,7 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
path = removeTrailingSlash(path)
return {
configurationFile: generatorConfigFile || './svelte.config.js',
configurationFile: generatorConfigFile || detectOrDefaultConfigFile('svelte.config'),
blankConfigurationFile: `${__dirname}/blank-configurations/sveltekit.js`,
properties: {
// Configure a base path
@@ -73,27 +89,23 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, sit
// Inject Pages configuration in a given static site generator's configuration file
function setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
const isSupportedFileExtension = SUPPORTED_FILE_EXTENSIONS.some(ext => generatorConfigFile.endsWith(ext))
if (generatorConfigFile && !isSupportedFileExtension) {
const supportedExtensionList = SUPPORTED_FILE_EXTENSIONS.map(ext => JSON.stringify(ext)).join(', ')
core.warning(
`Unsupported extension in configuration file: ${generatorConfigFile}. Currently supported extensions: ${supportedExtensionList}. We will still attempt to inject the site metadata into the configuration file, but it may not work as expected.`
)
}
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
)
}
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: ${error.message}`,
convertErrorToAnnotationProperties(error)
)
}
}