mirror of
https://github.com/actions/configure-pages.git
synced 2026-03-29 09:24:52 +00:00
Compare commits
204 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f0c5cde4b | ||
|
|
591bb0deb9 | ||
|
|
1465f012e6 | ||
|
|
f2fc553133 | ||
|
|
373694e352 | ||
|
|
b8130d9ab9 | ||
|
|
ffbbfa5ad0 | ||
|
|
18b91e4096 | ||
|
|
35974f9c62 | ||
|
|
17db653bf9 | ||
|
|
53f1f2445f | ||
|
|
5a19acb369 | ||
|
|
8914a00a27 | ||
|
|
7833dad43f | ||
|
|
9b4596cffd | ||
|
|
30652a8ca4 | ||
|
|
dd8c98825f | ||
|
|
5c432d4f0f | ||
|
|
7d8c7a7dc6 | ||
|
|
3a014131e9 | ||
|
|
2cbd45e4e0 | ||
|
|
d5e5fcfaf7 | ||
|
|
f156874f81 | ||
|
|
fe71f9ae5d | ||
|
|
41eccaebbe | ||
|
|
9cb82625f8 | ||
|
|
fadcf1a88f | ||
|
|
1269962883 | ||
|
|
ee9b267268 | ||
|
|
3f3c78f313 | ||
|
|
22baedcbd5 | ||
|
|
5549504006 | ||
|
|
dbf7935b84 | ||
|
|
905065c25d | ||
|
|
17109fe139 | ||
|
|
2a4c30ee0a | ||
|
|
031419c070 | ||
|
|
17d80648a1 | ||
|
|
f207b2fdea | ||
|
|
7110e9e03f | ||
|
|
2139388aaf | ||
|
|
1249305e58 | ||
|
|
29466e6602 | ||
|
|
596b326b9b | ||
|
|
0f0e83884b | ||
|
|
fb49e2740e | ||
|
|
8255d25c18 | ||
|
|
425a42e364 | ||
|
|
e9cfa1e1db | ||
|
|
d11b920341 | ||
|
|
84ab70e745 | ||
|
|
b287dc6263 | ||
|
|
f92583d4ab | ||
|
|
231f4e0d00 | ||
|
|
dfe5b0f888 | ||
|
|
0b5c9335ec | ||
|
|
457b08648b | ||
|
|
406a88e3a9 | ||
|
|
fc89b04e7d | ||
|
|
83d8e1aa25 | ||
|
|
9b64f8160b | ||
|
|
5a875285a3 | ||
|
|
873190cca3 | ||
|
|
ca9e52a2a5 | ||
|
|
32d8c4da59 | ||
|
|
e89f5c9189 | ||
|
|
f46cda8a64 | ||
|
|
cc656c2b3d | ||
|
|
28756f76e4 | ||
|
|
e3c441b6cf | ||
|
|
23968016b8 | ||
|
|
3d4ee3e950 | ||
|
|
cdda64832d | ||
|
|
38eb20d0ee | ||
|
|
36b9431494 | ||
|
|
179e061a24 | ||
|
|
175172ab3d | ||
|
|
685a74a557 | ||
|
|
84be8935f1 | ||
|
|
24bc4a64af | ||
|
|
ea72118a93 | ||
|
|
f98f257726 | ||
|
|
995b240285 | ||
|
|
c6c1171c00 | ||
|
|
ea6c51c96e | ||
|
|
8ece2a9a22 | ||
|
|
54f3ebf2d1 | ||
|
|
c8baff747f | ||
|
|
549319b80b | ||
|
|
7d88dd59cd | ||
|
|
b1748b08d7 | ||
|
|
66f86d58c8 | ||
|
|
d8adc44149 | ||
|
|
50408c8053 | ||
|
|
ccd0e3abe9 | ||
|
|
a4a37a13a6 | ||
|
|
4bfe138e84 | ||
|
|
37538b280c | ||
|
|
8d642d8eae | ||
|
|
9b8d2f4ab2 | ||
|
|
e2f34b1f92 | ||
|
|
7aebbf763e | ||
|
|
6a2b91eafe | ||
|
|
939d05ad85 | ||
|
|
0ca1df54d4 | ||
|
|
5c42783e5b | ||
|
|
13d4de8a28 | ||
|
|
5aa8bf5ac6 | ||
|
|
1d79de2fe7 | ||
|
|
5a80553d12 | ||
|
|
7eb7a15548 | ||
|
|
b8c94fdc9e | ||
|
|
9b358e73bb | ||
|
|
13e6bc7a20 | ||
|
|
0968db9eff | ||
|
|
3c444c051b | ||
|
|
12fd9a085c | ||
|
|
a8216d627c | ||
|
|
5992ce8fd5 | ||
|
|
c8deda3832 | ||
|
|
5d8963e8a5 | ||
|
|
529ba710d5 | ||
|
|
29e9dd5abe | ||
|
|
c450a282d7 | ||
|
|
6567d4c154 | ||
|
|
aba1aa6bab | ||
|
|
6a80311a73 | ||
|
|
380c12d4cc | ||
|
|
c5a3e1159e | ||
|
|
a069fede0c | ||
|
|
2f460cfbe0 | ||
|
|
e5c1ee9f14 | ||
|
|
7fea7010df | ||
|
|
34521f23a5 | ||
|
|
d84b27279d | ||
|
|
5650def507 | ||
|
|
0c2178e929 | ||
|
|
948e60fb96 | ||
|
|
1305a1ba92 | ||
|
|
b94e9adb36 | ||
|
|
fc8c2c4e6e | ||
|
|
e978eba337 | ||
|
|
343cb08233 | ||
|
|
f87a94c875 | ||
|
|
7eb40247a7 | ||
|
|
86f141f32d | ||
|
|
76b6a8292e | ||
|
|
8e221f24db | ||
|
|
d897860efd | ||
|
|
24270f0cca | ||
|
|
0c3c14948a | ||
|
|
b0c19d0de9 | ||
|
|
51323db177 | ||
|
|
3d9811d6e2 | ||
|
|
9c3b6344a2 | ||
|
|
97fb35057c | ||
|
|
c917d1c3cd | ||
|
|
ffa824f004 | ||
|
|
d4a76d1ee1 | ||
|
|
bd8a5da49f | ||
|
|
5cb77813a2 | ||
|
|
2094727a1b | ||
|
|
d875fa8dc1 | ||
|
|
67f329fcfd | ||
|
|
2ce6d5eaa1 | ||
|
|
bb6976f8d1 | ||
|
|
f2098a32c3 | ||
|
|
7fa35a05fd | ||
|
|
c3113876b0 | ||
|
|
af5f3c3f72 | ||
|
|
ad83b485e7 | ||
|
|
a84400a87f | ||
|
|
7a0a617c8a | ||
|
|
062df390be | ||
|
|
7619de7040 | ||
|
|
66e9ac3c2e | ||
|
|
4012a9fa87 | ||
|
|
4a12ff50fb | ||
|
|
a07391ec25 | ||
|
|
2491ca8488 | ||
|
|
875ec87ff9 | ||
|
|
4eadc891b5 | ||
|
|
c4feb8d01e | ||
|
|
1f9ca39237 | ||
|
|
1cefe6fc7c | ||
|
|
25a1ec8799 | ||
|
|
b9c4ac6c14 | ||
|
|
6e4f93b15d | ||
|
|
069c984c5e | ||
|
|
b030b061cb | ||
|
|
45efe60937 | ||
|
|
35c001ded6 | ||
|
|
27457957e6 | ||
|
|
7ec0edaa8e | ||
|
|
d48340abcd | ||
|
|
f53b57ff56 | ||
|
|
6d1d650751 | ||
|
|
61fd3a3cc1 | ||
|
|
0ec542a837 | ||
|
|
3a90973fd3 | ||
|
|
dc5b850bfd | ||
|
|
9a141972ca | ||
|
|
7d9bb68583 | ||
|
|
ec022f4ae9 |
17
.eslintrc.json
Normal file
17
.eslintrc.json
Normal 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
11
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'github-actions'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
42
.github/release-drafter.yml
vendored
42
.github/release-drafter.yml
vendored
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name-template: "v$RESOLVED_VERSION"
|
||||
tag-template: "v$RESOLVED_VERSION"
|
||||
name-template: 'v$RESOLVED_VERSION'
|
||||
tag-template: 'v$RESOLVED_VERSION'
|
||||
template: |
|
||||
# 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.
|
||||
categories:
|
||||
- title: "🚀 Features"
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
- "feature"
|
||||
- "enhancement"
|
||||
- title: "🐛 Bug Fixes"
|
||||
- 'feature'
|
||||
- 'enhancement'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- "fix"
|
||||
- "bugfix"
|
||||
- "bug"
|
||||
- title: "🧰 Maintenance"
|
||||
- 'fix'
|
||||
- 'bugfix'
|
||||
- 'bug'
|
||||
- title: '🧰 Maintenance'
|
||||
labels:
|
||||
- "infrastructure"
|
||||
- "automation"
|
||||
- "documentation"
|
||||
- title: "🏎 Performance"
|
||||
label: "performance"
|
||||
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
|
||||
- 'infrastructure'
|
||||
- 'automation'
|
||||
- 'documentation'
|
||||
- title: '🏎 Performance'
|
||||
label: 'performance'
|
||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||
version-resolver:
|
||||
major:
|
||||
labels:
|
||||
- "type: breaking"
|
||||
- 'type: breaking'
|
||||
minor:
|
||||
labels:
|
||||
- "type: enhancement"
|
||||
- 'type: enhancement'
|
||||
patch:
|
||||
labels:
|
||||
- "type: bug"
|
||||
- "type: maintenance"
|
||||
- "type: documentation"
|
||||
- 'type: bug'
|
||||
- 'type: maintenance'
|
||||
- 'type: documentation'
|
||||
default: patch
|
||||
|
||||
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version-file: '.node-version'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
7
.github/workflows/check-formatting.yml
vendored
7
.github/workflows/check-formatting.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Checking formatting
|
||||
name: Check formatting
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -17,14 +17,15 @@ concurrency:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 2
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.JS
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version-file: '.node-version'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
70
.github/workflows/codeql-analysis.yml
vendored
Normal file
70
.github/workflows/codeql-analysis.yml
vendored
Normal 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
|
||||
2
.github/workflows/draft-release.yml
vendored
2
.github/workflows/draft-release.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
draft-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
35
.github/workflows/lint.yml
vendored
Normal file
35
.github/workflows/lint.yml
vendored
Normal 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-file: '.node-version'
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint:check
|
||||
48
.github/workflows/rebuild-dependabot-prs.yml
vendored
Normal file
48
.github/workflows/rebuild-dependabot-prs.yml
vendored
Normal 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-file: '.node-version'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Rebuild the dist/ directory
|
||||
run: npm run prepare
|
||||
|
||||
- name: Commit any differences present in the dist/ directory
|
||||
run: |
|
||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||
echo "Detected uncommitted changes after rebuild in dist folder. Committing..."
|
||||
git add dist/
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git commit -m "Update distributables after Dependabot 🤖"
|
||||
echo "Pushing branch ${{ github.ref_name }}"
|
||||
git push origin ${{ github.ref_name }}
|
||||
fi
|
||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -1,11 +1,11 @@
|
||||
name: Release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
types: [released]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
TAG_NAME:
|
||||
description: "Tag name that the major tag will point to"
|
||||
description: 'Tag name that the major tag will point to'
|
||||
required: true
|
||||
|
||||
env:
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
steps:
|
||||
- name: Update the ${{ env.TAG_NAME }} tag
|
||||
id: update-major-tag
|
||||
uses: actions/publish-action@v0.1.0
|
||||
uses: actions/publish-action@v0.2.2
|
||||
with:
|
||||
source-tag: ${{ env.TAG_NAME }}
|
||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
- name: Setup Node.JS
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version-file: '.node-version'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
1
.node-version
Normal file
1
.node-version
Normal file
@@ -0,0 +1 @@
|
||||
20.10.0
|
||||
5
.prettierignore
Normal file
5
.prettierignore
Normal file
@@ -0,0 +1,5 @@
|
||||
# Ignore build artifacts
|
||||
/dist/
|
||||
|
||||
# Ignore all Markdown files
|
||||
*.md
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
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-path.js`](src/set-pages-path.js) for more details on how we configure static site generators to work "out of the box" with GitHub Pages.
|
||||
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
|
||||
|
||||
@@ -26,7 +26,7 @@ The scripts and documentation in this project are released under the [MIT Licens
|
||||
|
||||
<!-- references -->
|
||||
[starter-workflows]: https://github.com/actions/starter-workflows/tree/main/pages
|
||||
[release-list]: /releases
|
||||
[release-list]: https://github.com/actions/configure-pages/releases
|
||||
[draft-release]: .github/workflows/draft-release.yml
|
||||
[release]: .github/workflows/release.yml
|
||||
[release-workflow-runs]: /actions/workflows/release.yml
|
||||
[release-workflow-runs]: https://github.com/actions/configure-pages/actions/workflows/release.yml
|
||||
|
||||
10
action.yml
10
action.yml
@@ -2,7 +2,7 @@ name: 'Configure GitHub Pages'
|
||||
description: 'A GitHub Action to enable Pages, extract various metadata about a site, and configure some supported static site generators.'
|
||||
author: 'GitHub'
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
inputs:
|
||||
static_site_generator:
|
||||
@@ -16,15 +16,15 @@ inputs:
|
||||
default: ${{ github.token }}
|
||||
required: true
|
||||
enablement:
|
||||
description: 'Should a Pages site be enabled for the repository if not so already?'
|
||||
default: 'true'
|
||||
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:
|
||||
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:
|
||||
description: 'GitHub Pages site origin. Examples: "https://octocat.github.io", "https://www.example.com"'
|
||||
host:
|
||||
description: 'GitHub Pages site host. Examples: "octocat.github.io", "www.example.com"'
|
||||
base_path:
|
||||
description: 'GitHub Pages site full base path. Examples: "/my-repo/" or "/"'
|
||||
description: 'GitHub Pages site full base path. Examples: "/my-repo" or ""'
|
||||
|
||||
14986
dist/index.js
vendored
14986
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
753
dist/licenses.txt
vendored
753
dist/licenses.txt
vendored
@@ -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.
|
||||
|
||||
@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
|
||||
MIT
|
||||
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.
|
||||
|
||||
|
||||
@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
|
||||
MIT
|
||||
MIT License
|
||||
@@ -83,122 +277,228 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
asynckit
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
before-after-hook
|
||||
Apache-2.0
|
||||
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
|
||||
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:
|
||||
1. Definitions.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
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
|
||||
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.
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"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
|
||||
MIT
|
||||
Copyright (c) 2014-present Matt Zabriskie
|
||||
deprecation
|
||||
ISC
|
||||
The ISC License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Copyright (c) Gregor Martynus and contributors
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
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", 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.
|
||||
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
follow-redirects
|
||||
is-plain-object
|
||||
MIT
|
||||
Copyright 2014–present 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
|
||||
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:
|
||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
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.
|
||||
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.
|
||||
|
||||
|
||||
form-data
|
||||
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
|
||||
node-fetch
|
||||
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
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -572,18 +785,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
supports-color
|
||||
|
||||
once
|
||||
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.
|
||||
|
||||
|
||||
tr46
|
||||
MIT
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
tunnel
|
||||
MIT
|
||||
@@ -608,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,
|
||||
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)
|
||||
|
||||
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) 2015–2016 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.
|
||||
|
||||
8782
package-lock.json
generated
8782
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@@ -5,9 +5,12 @@
|
||||
"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": "./dist/index.js",
|
||||
"scripts": {
|
||||
"format": "prettier --write 'src/**/*.js'",
|
||||
"format:check": "prettier --check 'src/**/*.js'",
|
||||
"prepare": "npm run format && ncc build src/index.js -o dist --source-map --license licenses.txt",
|
||||
"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",
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
@@ -21,15 +24,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/actions/configure-pages#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.8.2",
|
||||
"axios": "^0.27.2",
|
||||
"axios-retry": "^3.2.5",
|
||||
"espree": "^9.3.2",
|
||||
"string-format": "^1.0.0"
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/github": "^5.1.1",
|
||||
"espree": "^9.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"jest": "^28.1.1",
|
||||
"prettier": "^2.7.1"
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"eslint": "^8.40.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-github": "^4.10.1",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^2.8.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
const axios = require('axios')
|
||||
const core = require('@actions/core')
|
||||
const github = require('@actions/github')
|
||||
|
||||
function getApiBaseUrl() {
|
||||
return process.env.GITHUB_API_URL || 'https://api.github.com'
|
||||
}
|
||||
|
||||
async function enablePagesSite({ repositoryNwo, githubToken }) {
|
||||
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
|
||||
async function enablePagesSite({ githubToken }) {
|
||||
const octokit = github.getOctokit(githubToken)
|
||||
|
||||
try {
|
||||
const response = await axios.post(
|
||||
pagesEndpoint,
|
||||
{ build_type: 'workflow' },
|
||||
{
|
||||
headers: {
|
||||
Accept: 'application/vnd.github.v3+json',
|
||||
Authorization: `Bearer ${githubToken}`,
|
||||
'Content-type': 'application/json'
|
||||
}
|
||||
}
|
||||
)
|
||||
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
|
||||
@@ -32,33 +22,30 @@ async function enablePagesSite({ repositoryNwo, githubToken }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getPagesSite({ repositoryNwo, githubToken }) {
|
||||
try {
|
||||
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
|
||||
async function getPagesSite({ githubToken }) {
|
||||
const octokit = github.getOctokit(githubToken)
|
||||
|
||||
const response = await axios.get(pagesEndpoint, {
|
||||
headers: {
|
||||
Accept: 'application/vnd.github.v3+json',
|
||||
Authorization: `Bearer ${githubToken}`
|
||||
}
|
||||
})
|
||||
const response = await octokit.rest.repos.getPages({
|
||||
owner: github.context.repo.owner,
|
||||
repo: github.context.repo.repo
|
||||
})
|
||||
|
||||
const pageObject = response.data
|
||||
return pageObject
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
const pageObject = response.data
|
||||
return pageObject
|
||||
}
|
||||
|
||||
async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement = true }) {
|
||||
async function findOrCreatePagesSite({ githubToken, enablement = true }) {
|
||||
let pageObject
|
||||
|
||||
// Try to find an existing Pages site first
|
||||
try {
|
||||
pageObject = await getPagesSite({ repositoryNwo, githubToken })
|
||||
pageObject = await getPagesSite({ githubToken })
|
||||
} catch (error) {
|
||||
if (!enablement) {
|
||||
core.error('Get Pages site failed', error)
|
||||
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)
|
||||
@@ -67,7 +54,7 @@ async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement =
|
||||
if (!pageObject && enablement) {
|
||||
// Create a new Pages site if one doesn't exist
|
||||
try {
|
||||
pageObject = await enablePagesSite({ repositoryNwo, githubToken })
|
||||
pageObject = await enablePagesSite({ githubToken })
|
||||
} catch (error) {
|
||||
core.error('Create Pages site failed', error)
|
||||
throw error
|
||||
@@ -77,7 +64,7 @@ async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement =
|
||||
// Try one more time for this extreme edge case!
|
||||
if (pageObject == null) {
|
||||
try {
|
||||
pageObject = await getPagesSite({ repositoryNwo, githubToken })
|
||||
pageObject = await getPagesSite({ githubToken })
|
||||
} catch (error) {
|
||||
core.error('Get Pages site still failed', error)
|
||||
throw error
|
||||
@@ -88,4 +75,4 @@ async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement =
|
||||
return pageObject
|
||||
}
|
||||
|
||||
module.exports = { findOrCreatePagesSite, enablePagesSite, getPagesSite, getApiBaseUrl }
|
||||
module.exports = { findOrCreatePagesSite, enablePagesSite, getPagesSite }
|
||||
|
||||
@@ -1,15 +1,34 @@
|
||||
const core = require('@actions/core')
|
||||
const axios = require('axios')
|
||||
|
||||
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_REPOSITORY = 'actions/is-awesome'
|
||||
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())
|
||||
@@ -18,46 +37,21 @@ describe('apiClient', () => {
|
||||
jest.spyOn(core, 'debug').mockImplementation(jest.fn())
|
||||
})
|
||||
|
||||
describe('getApiBaseUrl', () => {
|
||||
it('returns GITHUB_API_URL environment variable when set', async () => {
|
||||
const expectedBaseUrl = 'https://api.ghe.com'
|
||||
process.env.GITHUB_API_URL = expectedBaseUrl
|
||||
const result = apiClient.getApiBaseUrl()
|
||||
delete process.env.GITHUB_API_URL
|
||||
expect(result).toEqual(expectedBaseUrl)
|
||||
})
|
||||
|
||||
it('defaults to GitHub API if GITHUB_API_URL environment variable is empty', async () => {
|
||||
process.env.GITHUB_API_URL = ''
|
||||
const result = apiClient.getApiBaseUrl()
|
||||
delete process.env.GITHUB_API_URL
|
||||
expect(result).toEqual('https://api.github.com')
|
||||
})
|
||||
|
||||
it('defaults to GitHub API if GITHUB_API_URL environment variable is not set', async () => {
|
||||
delete process.env.GITHUB_API_URL
|
||||
const result = apiClient.getApiBaseUrl()
|
||||
expect(result).toEqual('https://api.github.com')
|
||||
})
|
||||
})
|
||||
|
||||
describe('enablePagesSite', () => {
|
||||
it('makes a request to create a page', async () => {
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
|
||||
|
||||
const result = await apiClient.enablePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
expect(result).toEqual(PAGE_OBJECT)
|
||||
})
|
||||
|
||||
it('handles a 409 response when the page already exists', async () => {
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
|
||||
|
||||
// Simply assert that no error is raised
|
||||
const result = await apiClient.enablePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
|
||||
@@ -65,12 +59,11 @@ describe('apiClient', () => {
|
||||
})
|
||||
|
||||
it('re-raises errors on failure status codes', async () => {
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
|
||||
let erred = false
|
||||
try {
|
||||
await apiClient.enablePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
} catch (error) {
|
||||
@@ -84,22 +77,20 @@ describe('apiClient', () => {
|
||||
describe('getPagesSite', () => {
|
||||
it('makes a request to get a page', async () => {
|
||||
const PAGE_OBJECT = { html_url: 'https://actions.github.io/is-awesome/' }
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
|
||||
mockGetPages.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
|
||||
|
||||
const result = await apiClient.getPagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
expect(result).toEqual(PAGE_OBJECT)
|
||||
})
|
||||
|
||||
it('re-raises errors on failure status codes', async () => {
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
|
||||
let erred = false
|
||||
try {
|
||||
await apiClient.getPagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
} catch (error) {
|
||||
@@ -113,55 +104,51 @@ describe('apiClient', () => {
|
||||
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/' }
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
mockGetPages.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
|
||||
const result = await apiClient.findOrCreatePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
expect(result).toEqual(PAGE_OBJECT)
|
||||
expect(axios.get).toHaveBeenCalledTimes(1)
|
||||
expect(axios.post).toHaveBeenCalledTimes(0)
|
||||
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/' }
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
|
||||
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
|
||||
|
||||
const result = await apiClient.findOrCreatePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
expect(result).toEqual(PAGE_OBJECT)
|
||||
expect(axios.get).toHaveBeenCalledTimes(1)
|
||||
expect(axios.post).toHaveBeenCalledTimes(1)
|
||||
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/' }
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
|
||||
mockGetPages.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.resolve({ status: 201, data: PAGE_OBJECT }))
|
||||
|
||||
const result = await apiClient.findOrCreatePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN,
|
||||
enablement: true
|
||||
})
|
||||
expect(result).toEqual(PAGE_OBJECT)
|
||||
expect(axios.get).toHaveBeenCalledTimes(1)
|
||||
expect(axios.post).toHaveBeenCalledTimes(1)
|
||||
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 () => {
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.reject({ response: { status: 500 } })) // just so they both aren't 404
|
||||
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({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN,
|
||||
enablement: false
|
||||
})
|
||||
@@ -171,18 +158,17 @@ describe('apiClient', () => {
|
||||
expect(error.response.status).toEqual(404)
|
||||
}
|
||||
expect(erred).toBe(true)
|
||||
expect(axios.get).toHaveBeenCalledTimes(1)
|
||||
expect(axios.post).toHaveBeenCalledTimes(0)
|
||||
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 () => {
|
||||
jest.spyOn(axios, 'get').mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.reject({ response: { status: 500 } })) // just so they both aren't 404
|
||||
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({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
} catch (error) {
|
||||
@@ -191,25 +177,23 @@ describe('apiClient', () => {
|
||||
expect(error.response.status).toEqual(500)
|
||||
}
|
||||
expect(erred).toBe(true)
|
||||
expect(axios.get).toHaveBeenCalledTimes(1)
|
||||
expect(axios.post).toHaveBeenCalledTimes(1)
|
||||
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/' }
|
||||
jest
|
||||
.spyOn(axios, 'get')
|
||||
mockGetPages
|
||||
.mockImplementationOnce(() => Promise.reject({ response: { status: 404 } }))
|
||||
.mockImplementationOnce(() => Promise.resolve({ status: 200, data: PAGE_OBJECT }))
|
||||
jest.spyOn(axios, 'post').mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
|
||||
mockCreatePagesSite.mockImplementationOnce(() => Promise.reject({ response: { status: 409 } }))
|
||||
|
||||
const result = await apiClient.findOrCreatePagesSite({
|
||||
repositoryNwo: GITHUB_REPOSITORY,
|
||||
githubToken: GITHUB_TOKEN
|
||||
})
|
||||
expect(result).toEqual(PAGE_OBJECT)
|
||||
expect(axios.get).toHaveBeenCalledTimes(2)
|
||||
expect(axios.post).toHaveBeenCalledTimes(1)
|
||||
expect(mockGetPages).toHaveBeenCalledTimes(2)
|
||||
expect(mockCreatePagesSite).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ Pages's path based routing (and work).
|
||||
|
||||
Supported configuration initializations:
|
||||
|
||||
(1) Default export:
|
||||
(1) Direct default export:
|
||||
|
||||
export default {
|
||||
// configuration object here
|
||||
@@ -21,19 +21,69 @@ Supported configuration initializations:
|
||||
// configuration object here
|
||||
}
|
||||
|
||||
(3) Indirect module export:
|
||||
(3) Indirect default export:
|
||||
|
||||
const config = // configuration object here
|
||||
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 {
|
||||
// Ctor
|
||||
// - configurationFile: path to the configuration file
|
||||
// - blankConfigurationFile: a blank configuration file to use if non was previously found
|
||||
constructor({ configurationFile, blankConfigurationFile, properties }) {
|
||||
constructor({ configurationFile, blankConfigurationFile, allowWrappingCall = false, properties }) {
|
||||
// Save field
|
||||
this.configurationFile = configurationFile
|
||||
this.allowWrappingCall = allowWrappingCall === true
|
||||
this.properties = properties
|
||||
|
||||
// If the configuration file does not exist, initialize it with the blank configuration file
|
||||
@@ -49,12 +99,43 @@ class ConfigParser {
|
||||
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 a default export, a direct module export or an indirect module
|
||||
// export (in that order).
|
||||
// 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) {
|
||||
findConfigurationObject(ast, allowWrappingCall = false) {
|
||||
// Try to find a default export
|
||||
var defaultExport = ast.body.find(node => node.type === 'ExportDefaultDeclaration')
|
||||
|
||||
@@ -64,21 +145,61 @@ class ConfigParser {
|
||||
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 identifierDefinition = ast.body.find(
|
||||
node =>
|
||||
node.type === 'VariableDeclaration' &&
|
||||
node.declarations.length == 1 &&
|
||||
node.declarations[0].type === 'VariableDeclarator' &&
|
||||
node.declarations[0].id.type === 'Identifier' &&
|
||||
node.declarations[0].id.name === identifierName &&
|
||||
node.declarations[0].init.type === 'ObjectExpression'
|
||||
)
|
||||
if (identifierDefinition) {
|
||||
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 identifierDefinition.declarations[0].init
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,21 +222,57 @@ class ConfigParser {
|
||||
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 identifierDefinition = ast.body.find(
|
||||
node =>
|
||||
node.type === 'VariableDeclaration' &&
|
||||
node.declarations.length == 1 &&
|
||||
node.declarations[0].type === 'VariableDeclarator' &&
|
||||
node.declarations[0].id.type === 'Identifier' &&
|
||||
node.declarations[0].id.name === identifierName &&
|
||||
node.declarations[0].init.type === 'ObjectExpression'
|
||||
)
|
||||
if (identifierDefinition) {
|
||||
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 identifierDefinition.declarations[0].init
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,16 +336,17 @@ class ConfigParser {
|
||||
const ast = espree.parse(this.configuration, espreeOptions)
|
||||
|
||||
// Find the configuration object
|
||||
var configurationObject = this.findConfigurationObject(ast)
|
||||
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 `.`
|
||||
// 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])
|
||||
@@ -265,7 +423,7 @@ class ConfigParser {
|
||||
}
|
||||
|
||||
// Logging
|
||||
core.info(`Injection successful, new configuration:`)
|
||||
core.info('Injection successful, new configuration:')
|
||||
core.info(this.configuration)
|
||||
|
||||
// Finally write the new configuration in the file
|
||||
|
||||
@@ -10,83 +10,83 @@ const tempFolder = getTempFolder()
|
||||
// Cases to test
|
||||
const cases = [
|
||||
//
|
||||
// Default export
|
||||
// Direct default export
|
||||
//
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default {}`,
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default {}',
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default { property: 0 }`, // property exists and is a number
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default { property: 0 }', // property exists and is a number
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default { property: false }`, // property exists and is a boolean
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default { property: false }', // property exists and is a boolean
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default { property: "test" }`, // property exists and is a string
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default { property: "test" }', // property exists and is a string
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default { property: [1,2] }`, // property exists and is an array
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default { property: [1,2] }', // property exists and is an array
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default { property: null }`, // property exists and is null
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default { property: null }', // property exists and is null
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `export default { property: {}}`, // property exists and is an object
|
||||
expected: `export default { property: "value" }`
|
||||
source: 'export default { property: { } }', // property exists and is an object
|
||||
expected: 'export default { property: "value" }'
|
||||
},
|
||||
|
||||
// Deep properties (injection 1)
|
||||
{
|
||||
property: 'property.b.c',
|
||||
source: `export default {}`,
|
||||
expected: `export default { property: { b: { c: "value" }}}`
|
||||
source: 'export default {}',
|
||||
expected: 'export default { property: { b: { c: "value" } } }'
|
||||
},
|
||||
{
|
||||
property: 'property.b.c',
|
||||
source: `export default { property: 0 }`, // property exists and is a number
|
||||
expected: `export default { property: { b: { c: "value" }}}`
|
||||
source: 'export default { property: 0 }', // property exists and is a number
|
||||
expected: 'export default { property: { b: { c: "value" } } }'
|
||||
},
|
||||
{
|
||||
property: 'property.b.c',
|
||||
source: `export default { property: {}}`, // property exists and is an object
|
||||
expected: `export default { property: { b: { c: "value" }}}`
|
||||
source: 'export default { property: { } }', // property exists and is an object
|
||||
expected: 'export default { property: { b: { c: "value" } } }'
|
||||
},
|
||||
|
||||
// Deep properties (injection 2)
|
||||
{
|
||||
property: 'property.b.c',
|
||||
source: `export default { property: { b: 0 }}`, // property exists and is a number
|
||||
expected: `export default { property: { b: { c: "value" }}}`
|
||||
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" }}}`
|
||||
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 }}}`
|
||||
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]}}`
|
||||
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] } }'
|
||||
},
|
||||
|
||||
//
|
||||
@@ -94,23 +94,25 @@ const cases = [
|
||||
//
|
||||
{
|
||||
property: 'property',
|
||||
source: `const config = {}; export default config`,
|
||||
expected: `const config = { property: "value"}; export default config`
|
||||
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 config = {}; export default config`,
|
||||
expected: `var config = { property: "value"}; export default config`
|
||||
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 = {}; 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`
|
||||
source: 'var config = { a: { b: [], c: "hello" } }; export default config',
|
||||
expected: 'var config = { a: { b: { c: "value"}, c: "hello" } }; export default config'
|
||||
},
|
||||
|
||||
//
|
||||
@@ -118,18 +120,18 @@ const cases = [
|
||||
//
|
||||
{
|
||||
property: 'property',
|
||||
source: `module.exports = {}`,
|
||||
expected: `module.exports = { property: "value"}`
|
||||
source: 'module.exports = {}',
|
||||
expected: 'module.exports = { property: "value"}'
|
||||
},
|
||||
{
|
||||
property: 'property',
|
||||
source: `module.exports = { p1: 0}`,
|
||||
expected: `module.exports = { property: "value", p1: 0}`
|
||||
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}`
|
||||
source: 'module.exports = { p1: 0}',
|
||||
expected: 'module.exports = { a: { b: { c: "value" } }, p1: 0}'
|
||||
},
|
||||
|
||||
//
|
||||
@@ -137,23 +139,128 @@ const cases = [
|
||||
//
|
||||
{
|
||||
property: 'property',
|
||||
source: `const config = {}; module.exports = config`,
|
||||
expected: `const config = { property: "value"}; module.exports = config`
|
||||
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 config = {}; module.exports = config`,
|
||||
expected: `var config = { property: "value"}; module.exports = config`
|
||||
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 = {}; module.exports = config`,
|
||||
expected: `var config = { a: { b: { c: "value"}}}; module.exports = config`
|
||||
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: '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`
|
||||
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
|
||||
}
|
||||
]
|
||||
|
||||
@@ -168,7 +275,7 @@ describe('config-parser', () => {
|
||||
jest.spyOn(core, 'debug').mockImplementation(jest.fn())
|
||||
})
|
||||
|
||||
cases.forEach(({ property, source, expected }, index) => {
|
||||
cases.forEach(({ property, source, expected, allowWrappingCall = false }, index) => {
|
||||
it(`injects path properly for case #${index}`, () => {
|
||||
// Write the source file
|
||||
const sourceFile = `${tempFolder}/source.js`
|
||||
@@ -180,7 +287,8 @@ describe('config-parser', () => {
|
||||
|
||||
// Update the settings and do the injection
|
||||
new ConfigParser({
|
||||
configurationFile: sourceFile
|
||||
configurationFile: sourceFile,
|
||||
allowWrappingCall
|
||||
}).inject(property, 'value')
|
||||
|
||||
// Compare the files
|
||||
|
||||
@@ -3,11 +3,10 @@ const core = require('@actions/core')
|
||||
// Load variables from Actions runtime
|
||||
function getRequiredVars() {
|
||||
return {
|
||||
repositoryNwo: process.env.GITHUB_REPOSITORY,
|
||||
githubToken: core.getInput('token'),
|
||||
staticSiteGenerator: core.getInput('static_site_generator'),
|
||||
generatorConfigFile: core.getInput('generator_config_file'),
|
||||
enablement: core.getInput('enablement') !== 'false'
|
||||
enablement: core.getInput('enablement') === 'true'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Default Pages configuration for Gatsby
|
||||
module.exports = { pathPrefix: '/docs/' }
|
||||
module.exports = { siteMetadata: { siteUrl: 'https://configure-pages.github.io' }, pathPrefix: '/docs/' }
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
title: `My Gatsby Site`,
|
||||
siteUrl: `https://www.yourdomain.tld`,
|
||||
title: 'My Gatsby Site'
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
plugins: []
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module.exports = {
|
||||
pathPrefix: "/docs/",
|
||||
pathPrefix: '/docs/',
|
||||
siteMetadata: {
|
||||
title: `My Gatsby Site`,
|
||||
siteUrl: `https://www.yourdomain.tld`,
|
||||
siteUrl: 'https://configure-pages.github.io',
|
||||
title: 'My Gatsby Site'
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
plugins: []
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module.exports = {
|
||||
pathPrefix: '/docs/',
|
||||
siteMetadata: {
|
||||
title: `My Gatsby Site`,
|
||||
siteUrl: `https://www.yourdomain.tld`
|
||||
siteUrl: 'https://configure-pages.github.io',
|
||||
title: 'My Gatsby Site'
|
||||
},
|
||||
plugins: []
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
export default {
|
||||
pathPrefix: "/docs/",
|
||||
pathPrefix: '/docs/',
|
||||
siteMetadata: {
|
||||
title: `My Gatsby Site`,
|
||||
siteUrl: `https://www.yourdomain.tld`,
|
||||
siteUrl: 'https://configure-pages.github.io',
|
||||
title: 'My Gatsby Site'
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
plugins: []
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
title: `My Gatsby Site`,
|
||||
siteUrl: `https://www.yourdomain.tld`
|
||||
title: 'My Gatsby Site'
|
||||
},
|
||||
plugins: []
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export default {
|
||||
siteMetadata: {
|
||||
title: `My Gatsby Site`,
|
||||
siteUrl: `https://www.yourdomain.tld`,
|
||||
title: 'My Gatsby Site'
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
plugins: []
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// Default Pages configuration for Next
|
||||
const nextConfig = { experimental: { images: { unoptimized: true } }, basePath: '/docs' }
|
||||
const nextConfig = { images: { unoptimized: true }, experimental: { images: { unoptimized: true } }, basePath: '/docs' }
|
||||
module.exports = nextConfig
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
swcMinify: true,
|
||||
swcMinify: true
|
||||
}
|
||||
|
||||
module.exports = nextConfig
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {images: {unoptimized: true}},
|
||||
images: { unoptimized: true },
|
||||
experimental: { images: { unoptimized: true } },
|
||||
basePath: '/docs',
|
||||
reactStrictMode: true,
|
||||
swcMinify: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
images: { unoptimized: true },
|
||||
experimental: { images: { unoptimized: true } },
|
||||
basePath: '/docs',
|
||||
reactStrictMode: true,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
experimental: {images: {unoptimized: true}},
|
||||
images: { unoptimized: true },
|
||||
experimental: { images: { unoptimized: true } },
|
||||
basePath: '/docs',
|
||||
reactStrictMode: true,
|
||||
swcMinify: true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
swcMinify: true,
|
||||
swcMinify: true
|
||||
}
|
||||
|
||||
export default nextConfig
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
const getAllDynamicRoute = async function() {
|
||||
const getAllDynamicRoute = async function () {
|
||||
const routes = await (async () => {
|
||||
return ['/posts/hello-world', '/posts/hello-again'];
|
||||
})();
|
||||
return routes;
|
||||
};
|
||||
return ['/posts/hello-world', '/posts/hello-again']
|
||||
})()
|
||||
return routes
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
mode: 'universal',
|
||||
generate: {
|
||||
async routes () {
|
||||
return getAllDynamicRoute();
|
||||
async routes() {
|
||||
return getAllDynamicRoute()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
const getAllDynamicRoute = async function() {
|
||||
const getAllDynamicRoute = async function () {
|
||||
const routes = await (async () => {
|
||||
return ['/posts/hello-world', '/posts/hello-again'];
|
||||
})();
|
||||
return routes;
|
||||
};
|
||||
return ['/posts/hello-world', '/posts/hello-again']
|
||||
})()
|
||||
return routes
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
target: 'static',
|
||||
router: {base: '/docs/'},
|
||||
router: { base: '/docs/' },
|
||||
mode: 'universal',
|
||||
generate: {
|
||||
async routes () {
|
||||
return getAllDynamicRoute();
|
||||
async routes() {
|
||||
return getAllDynamicRoute()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
const getAllDynamicRoute = async function() {
|
||||
const getAllDynamicRoute = async function () {
|
||||
const routes = await (async () => {
|
||||
return ['/posts/hello-world', '/posts/hello-again'];
|
||||
})();
|
||||
return routes;
|
||||
};
|
||||
return ['/posts/hello-world', '/posts/hello-again']
|
||||
})()
|
||||
return routes
|
||||
}
|
||||
|
||||
export default {
|
||||
target: 'static',
|
||||
router: {base: '/docs/'},
|
||||
router: { base: '/docs/' },
|
||||
mode: 'universal',
|
||||
generate: {
|
||||
async routes () {
|
||||
return getAllDynamicRoute();
|
||||
async routes() {
|
||||
return getAllDynamicRoute()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
const getAllDynamicRoute = async function() {
|
||||
const getAllDynamicRoute = async function () {
|
||||
const routes = await (async () => {
|
||||
return ['/posts/hello-world', '/posts/hello-again'];
|
||||
})();
|
||||
return routes;
|
||||
};
|
||||
return ['/posts/hello-world', '/posts/hello-again']
|
||||
})()
|
||||
return routes
|
||||
}
|
||||
|
||||
export default {
|
||||
mode: 'universal',
|
||||
generate: {
|
||||
async routes () {
|
||||
return getAllDynamicRoute();
|
||||
async routes() {
|
||||
return getAllDynamicRoute()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,31 +14,24 @@ module.exports = {
|
||||
{ hid: 'description', name: 'description', content: '' },
|
||||
{ name: 'format-detection', content: 'telephone=no' }
|
||||
],
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
||||
]
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
||||
},
|
||||
|
||||
// Global CSS: https://go.nuxtjs.dev/config-css
|
||||
css: [
|
||||
],
|
||||
css: [],
|
||||
|
||||
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
||||
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: [
|
||||
],
|
||||
buildModules: [],
|
||||
|
||||
// Modules: https://go.nuxtjs.dev/config-modules
|
||||
modules: [
|
||||
],
|
||||
modules: [],
|
||||
|
||||
// Build Configuration: https://go.nuxtjs.dev/config-build
|
||||
build: {
|
||||
}
|
||||
}
|
||||
build: {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
||||
target: 'static',
|
||||
router: { base: "/docs/" },
|
||||
router: { base: '/docs/' },
|
||||
ssr: false,
|
||||
|
||||
// Global page headers: https://go.nuxtjs.dev/config-head
|
||||
@@ -16,31 +16,24 @@ module.exports = {
|
||||
{ hid: 'description', name: 'description', content: '' },
|
||||
{ name: 'format-detection', content: 'telephone=no' }
|
||||
],
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
||||
]
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
||||
},
|
||||
|
||||
// Global CSS: https://go.nuxtjs.dev/config-css
|
||||
css: [
|
||||
],
|
||||
css: [],
|
||||
|
||||
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
||||
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: [
|
||||
],
|
||||
buildModules: [],
|
||||
|
||||
// Modules: https://go.nuxtjs.dev/config-modules
|
||||
modules: [
|
||||
],
|
||||
modules: [],
|
||||
|
||||
// Build Configuration: https://go.nuxtjs.dev/config-build
|
||||
build: {
|
||||
}
|
||||
}
|
||||
build: {}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
||||
target: 'static',
|
||||
router: { base: "/docs/" },
|
||||
router: { base: '/docs/' },
|
||||
ssr: false,
|
||||
|
||||
// Global page headers: https://go.nuxtjs.dev/config-head
|
||||
@@ -16,31 +16,24 @@ export default {
|
||||
{ hid: 'description', name: 'description', content: '' },
|
||||
{ name: 'format-detection', content: 'telephone=no' }
|
||||
],
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
||||
]
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
||||
},
|
||||
|
||||
// Global CSS: https://go.nuxtjs.dev/config-css
|
||||
css: [
|
||||
],
|
||||
css: [],
|
||||
|
||||
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
||||
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: [
|
||||
],
|
||||
buildModules: [],
|
||||
|
||||
// Modules: https://go.nuxtjs.dev/config-modules
|
||||
modules: [
|
||||
],
|
||||
modules: [],
|
||||
|
||||
// Build Configuration: https://go.nuxtjs.dev/config-build
|
||||
build: {
|
||||
}
|
||||
}
|
||||
build: {}
|
||||
}
|
||||
|
||||
@@ -14,31 +14,24 @@ export default {
|
||||
{ hid: 'description', name: 'description', content: '' },
|
||||
{ name: 'format-detection', content: 'telephone=no' }
|
||||
],
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
|
||||
]
|
||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
||||
},
|
||||
|
||||
// Global CSS: https://go.nuxtjs.dev/config-css
|
||||
css: [
|
||||
],
|
||||
css: [],
|
||||
|
||||
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
||||
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: [
|
||||
],
|
||||
buildModules: [],
|
||||
|
||||
// Modules: https://go.nuxtjs.dev/config-modules
|
||||
modules: [
|
||||
],
|
||||
modules: [],
|
||||
|
||||
// Build Configuration: https://go.nuxtjs.dev/config-build
|
||||
build: {
|
||||
}
|
||||
}
|
||||
build: {}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import adapter from '@sveltejs/adapter-auto'
|
||||
|
||||
export default {
|
||||
kit: {
|
||||
prerender: { origin: 'https://configure-pages.github.io' },
|
||||
paths: { base: '/docs' },
|
||||
adapter: adapter()
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ 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()
|
||||
}
|
||||
|
||||
@@ -4,18 +4,18 @@ const core = require('@actions/core')
|
||||
const { getContext } = require('./context')
|
||||
|
||||
const { findOrCreatePagesSite } = require('./api-client')
|
||||
const { setPagesPath } = require('./set-pages-path')
|
||||
const { setPagesConfig } = require('./set-pages-config')
|
||||
const outputPagesBaseUrl = require('./output-pages-base-url')
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const { repositoryNwo, githubToken, enablement, staticSiteGenerator, generatorConfigFile } = getContext()
|
||||
const { githubToken, enablement, staticSiteGenerator, generatorConfigFile } = getContext()
|
||||
|
||||
const pageObject = await findOrCreatePagesSite({ repositoryNwo, githubToken, enablement })
|
||||
const pageObject = await findOrCreatePagesSite({ githubToken, enablement })
|
||||
const siteUrl = new URL(pageObject.html_url)
|
||||
|
||||
if (staticSiteGenerator) {
|
||||
setPagesPath({ staticSiteGenerator, generatorConfigFile, path: siteUrl.pathname })
|
||||
setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl })
|
||||
}
|
||||
outputPagesBaseUrl(siteUrl)
|
||||
core.exportVariable('GITHUB_PAGES', 'true')
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
const core = require('@actions/core')
|
||||
const removeTrailingSlash = require('./remove-trailing-slash')
|
||||
|
||||
function outputPagesBaseUrl(siteUrl) {
|
||||
core.setOutput('base_url', siteUrl.href)
|
||||
// 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', siteUrl.pathname)
|
||||
core.setOutput('base_path', basePath)
|
||||
}
|
||||
|
||||
module.exports = outputPagesBaseUrl
|
||||
|
||||
@@ -23,10 +23,10 @@ describe('outputPagesBaseUrl', () => {
|
||||
|
||||
outputPagesBaseUrl(new URL(baseUrl))
|
||||
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_url', baseUrl)
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_url', '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('base_path', '/')
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_path', '')
|
||||
})
|
||||
|
||||
it('gets expected outputs for project site', async () => {
|
||||
@@ -34,10 +34,10 @@ describe('outputPagesBaseUrl', () => {
|
||||
|
||||
outputPagesBaseUrl(new URL(baseUrl))
|
||||
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_url', baseUrl)
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_url', 'https://octocat.github.io/my-repo')
|
||||
expect(core.setOutput).toHaveBeenCalledWith('origin', 'https://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 () => {
|
||||
@@ -45,9 +45,9 @@ describe('outputPagesBaseUrl', () => {
|
||||
|
||||
outputPagesBaseUrl(new URL(baseUrl))
|
||||
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_url', baseUrl)
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_url', '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('base_path', '/')
|
||||
expect(core.setOutput).toHaveBeenCalledWith('base_path', '')
|
||||
})
|
||||
})
|
||||
|
||||
3
src/remove-trailing-slash.js
Normal file
3
src/remove-trailing-slash.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function removeTrailingSlash(str) {
|
||||
return str.endsWith('/') ? str.slice(0, -1) : str
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
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 path value to inject
|
||||
function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, path }) {
|
||||
// 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 {
|
||||
@@ -20,9 +25,7 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, pat
|
||||
}
|
||||
case 'next':
|
||||
// Next does not want a trailing slash
|
||||
if (path.endsWith('/')) {
|
||||
path = path.slice(0, -1)
|
||||
}
|
||||
path = removeTrailingSlash(path)
|
||||
|
||||
return {
|
||||
configurationFile: generatorConfigFile || './next.config.js',
|
||||
@@ -33,7 +36,9 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, pat
|
||||
|
||||
// Disable server side image optimization too
|
||||
// https://nextjs.org/docs/api-reference/next/image#unoptimized
|
||||
'experimental.images.unoptimized': true
|
||||
'experimental.images.unoptimized': true,
|
||||
// No longer experimental as of Next.js v12.3.0
|
||||
'images.unoptimized': true
|
||||
}
|
||||
}
|
||||
case 'gatsby':
|
||||
@@ -42,21 +47,23 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, pat
|
||||
blankConfigurationFile: `${__dirname}/blank-configurations/gatsby.js`,
|
||||
properties: {
|
||||
// Configure a path prefix
|
||||
pathPrefix: path
|
||||
pathPrefix: path,
|
||||
// Configure a site url
|
||||
'siteMetadata.siteUrl': origin
|
||||
}
|
||||
}
|
||||
case 'sveltekit':
|
||||
// SvelteKit does not want a trailing slash
|
||||
if (path.endsWith('/')) {
|
||||
path = path.slice(0, -1)
|
||||
}
|
||||
path = removeTrailingSlash(path)
|
||||
|
||||
return {
|
||||
configurationFile: generatorConfigFile || './svelte.config.js',
|
||||
blankConfigurationFile: `${__dirname}/blank-configurations/sveltekit.js`,
|
||||
properties: {
|
||||
// Configure a base path
|
||||
'kit.paths.base': path
|
||||
'kit.paths.base': path,
|
||||
// Configure a prerender origin
|
||||
'kit.prerender.origin': origin
|
||||
}
|
||||
}
|
||||
default:
|
||||
@@ -65,18 +72,29 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, pat
|
||||
}
|
||||
|
||||
// Inject Pages configuration in a given static site generator's configuration file
|
||||
function setPagesPath({ staticSiteGenerator, generatorConfigFile, path }) {
|
||||
function setPagesConfig({ staticSiteGenerator, generatorConfigFile, siteUrl }) {
|
||||
try {
|
||||
// Parse the configuration file and try to inject the Pages configuration in it
|
||||
const settings = getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, path })
|
||||
const settings = getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, siteUrl })
|
||||
new ConfigParser(settings).injectAll()
|
||||
} catch (error) {
|
||||
const isSupportedFileExtension = SUPPORTED_FILE_EXTENSIONS.some(ext => generatorConfigFile.endsWith(ext))
|
||||
|
||||
// Logging
|
||||
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
|
||||
)
|
||||
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, setPagesPath }
|
||||
module.exports = { getConfigParserSettings, setPagesConfig }
|
||||
@@ -2,8 +2,7 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const core = require('@actions/core')
|
||||
|
||||
const { getConfigParserSettings } = require('./set-pages-path')
|
||||
const { ConfigParser } = require('./config-parser')
|
||||
const { setPagesConfig } = require('./set-pages-config')
|
||||
const { getTempFolder, compareFiles } = require('./test-helpers')
|
||||
|
||||
// Get the temp folder
|
||||
@@ -11,6 +10,13 @@ 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', () => {
|
||||
@@ -32,6 +38,9 @@ describe('configParser', () => {
|
||||
// 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
|
||||
@@ -41,18 +50,18 @@ describe('configParser', () => {
|
||||
// Copy the source fixture to a temp file
|
||||
const fixtureSourceFile = `${fixtureFolder}/${configurationFile}`
|
||||
const fixtureTargetFile = `${tempFolder}/${configurationFile}`
|
||||
if (configurationFile !== 'blank.js') {
|
||||
if (!isBlankConfigFileName(configurationFile)) {
|
||||
fs.copyFileSync(fixtureSourceFile, fixtureTargetFile)
|
||||
} else if (fs.existsSync(fixtureTargetFile)) {
|
||||
fs.rmSync(fixtureTargetFile)
|
||||
}
|
||||
|
||||
// Get settings for the static site generator
|
||||
const settings = getConfigParserSettings({ staticSiteGenerator, path: '/docs/' })
|
||||
// Update the settings
|
||||
settings.configurationFile = fixtureTargetFile
|
||||
// Do the injection
|
||||
new ConfigParser(settings).injectAll()
|
||||
// Do the injections for the static site generator
|
||||
setPagesConfig({
|
||||
staticSiteGenerator,
|
||||
generatorConfigFile: fixtureTargetFile,
|
||||
siteUrl
|
||||
})
|
||||
|
||||
// Read the expected file
|
||||
const expectedFile = `${fixtureFolder}/${path.basename(
|
||||
@@ -61,7 +70,7 @@ describe('configParser', () => {
|
||||
)}.expected${defaultFileExtension}`
|
||||
|
||||
// Compare the actual and expected files
|
||||
compareFiles(settings.configurationFile, expectedFile)
|
||||
compareFiles(fixtureTargetFile, expectedFile)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -74,22 +83,19 @@ describe('configParser', () => {
|
||||
// Copy the source fixture to a temp file
|
||||
const fixtureSourceFile = `${fixtureFolder}/${configurationFile}`
|
||||
const fixtureTargetFile = `${tempFolder}/${configurationFile}`
|
||||
if (configurationFile !== 'blank.js') {
|
||||
if (!isBlankConfigFileName(configurationFile)) {
|
||||
fs.copyFileSync(fixtureSourceFile, fixtureTargetFile)
|
||||
} else if (fs.existsSync(fixtureTargetFile)) {
|
||||
fs.rmSync(fixtureTargetFile)
|
||||
}
|
||||
|
||||
// Get settings for the static site generator
|
||||
const settings = getConfigParserSettings({
|
||||
// Do the injections for the static site generator
|
||||
setPagesConfig({
|
||||
staticSiteGenerator,
|
||||
generatorConfigFile: fixtureTargetFile,
|
||||
path: '/docs/'
|
||||
siteUrl
|
||||
})
|
||||
|
||||
// Do the injection
|
||||
new ConfigParser(settings).injectAll()
|
||||
|
||||
// Read the expected file
|
||||
const expectedFile = `${fixtureFolder}/${path.basename(
|
||||
configurationFile,
|
||||
@@ -97,7 +103,7 @@ describe('configParser', () => {
|
||||
)}.expected${fileExtension}`
|
||||
|
||||
// Compare the actual and expected files
|
||||
compareFiles(settings.configurationFile, expectedFile)
|
||||
compareFiles(fixtureTargetFile, expectedFile)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user