mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Merge branch 'dev' into releases/v4
This commit is contained in:
commit
432c473020
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
|||||||
yarn test
|
yarn test
|
||||||
|
|
||||||
- name: Uploade CodeCov Report
|
- name: Uploade CodeCov Report
|
||||||
uses: codecov/codecov-action@v3.1.0
|
uses: codecov/codecov-action@v3.1.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
1
.github/workflows/integration.yml
vendored
1
.github/workflows/integration.yml
vendored
@ -34,6 +34,7 @@ jobs:
|
|||||||
git-config-email: montezuma@jamesiv.es
|
git-config-email: montezuma@jamesiv.es
|
||||||
repository-name: MontezumaIves/lab
|
repository-name: MontezumaIves/lab
|
||||||
token: ${{ secrets.ACCESS_TOKEN }}
|
token: ${{ secrets.ACCESS_TOKEN }}
|
||||||
|
commit-message: 'Test commit'
|
||||||
folder: integration
|
folder: integration
|
||||||
single-commit: true
|
single-commit: true
|
||||||
clean: true
|
clean: true
|
||||||
|
2
.github/workflows/sponsors.yml
vendored
2
.github/workflows/sponsors.yml
vendored
@ -18,7 +18,6 @@ jobs:
|
|||||||
file: 'README.md'
|
file: 'README.md'
|
||||||
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="50px" alt="{{{ login }}}" /></a> '
|
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="50px" alt="{{{ login }}}" /></a> '
|
||||||
maximum: 9999
|
maximum: 9999
|
||||||
organization: true
|
|
||||||
|
|
||||||
- name: Generate Sponsors 💖
|
- name: Generate Sponsors 💖
|
||||||
uses: JamesIves/github-sponsors-readme-action@v1
|
uses: JamesIves/github-sponsors-readme-action@v1
|
||||||
@ -28,7 +27,6 @@ jobs:
|
|||||||
minimum: 10000
|
minimum: 10000
|
||||||
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="80px" alt="{{{ login }}}" /></a> '
|
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="80px" alt="{{{ login }}}" /></a> '
|
||||||
marker: 'premium'
|
marker: 'premium'
|
||||||
organization: true
|
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: JamesIves/github-pages-deploy-action@v4
|
uses: JamesIves/github-pages-deploy-action@v4
|
||||||
|
45
README.md
45
README.md
@ -43,7 +43,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<!-- premium --><a href="https://github.com/github"><img src="https://github.com/github.png" width="80px" alt="github" /></a> <!-- premium -->
|
<!-- premium --><!-- premium -->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@ -89,52 +89,14 @@ on:
|
|||||||
- main
|
- main
|
||||||
```
|
```
|
||||||
|
|
||||||
It's recommended that you use [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically) to keep your workflow up-to-date and [secure](https://github.com/features/security). You can find the latest tagged version on the [GitHub Marketplace](https://github.com/marketplace/actions/deploy-to-github-pages) or on the [releases page](https://github.com/JamesIves/github-pages-deploy-action/releases).
|
> **Warning**
|
||||||
|
> If you do not supply the action with an access token or an SSH key, you must access your repositories settings and provide `Read and Write Permissions` to the provided `GITHUB_TOKEN`, otherwise you'll potentially run into permission issues. Alternatively you can set the following in your workflow file to grant the action the permissions it needs.
|
||||||
#### Permission Settings ⚠️
|
|
||||||
|
|
||||||
If you do not supply the action with an access token or an SSH key, you must access your repositories settings and provide `Read and Write Permissions` to the provided `GITHUB_TOKEN`, otherwise you'll potentailly run into permission issues. Alternatively you can set the following in your workflow file to grant the action the permissions it needs.
|
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Install as a Node Module 📦
|
|
||||||
|
|
||||||
If you'd like to use the functionality provided by this action in your own action you can either [create a composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action), or you can install it using [yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/get-npm) by running the following commands. It's available on both the [npm](https://www.npmjs.com/package/@jamesives/github-pages-deploy-action) and [GitHub registry](https://github.com/JamesIves/github-pages-deploy-action/packages/229985).
|
|
||||||
|
|
||||||
```
|
|
||||||
yarn add @jamesives/github-pages-deploy-action
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
npm install @jamesives/github-pages-deploy-action
|
|
||||||
```
|
|
||||||
|
|
||||||
It can then be imported into your project like so.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import run from '@jamesives/github-pages-deploy-action'
|
|
||||||
```
|
|
||||||
|
|
||||||
Calling the functions directly will require you to pass in an object containing the variables found in the configuration section, you'll also need to provide a `workspace` with a path to your project.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import run from '@jamesives/github-pages-deploy-action'
|
|
||||||
|
|
||||||
run({
|
|
||||||
token: process.env['ACCESS_TOKEN'],
|
|
||||||
folder: 'build',
|
|
||||||
repositoryName: 'JamesIves/github-pages-deploy-action',
|
|
||||||
silent: true,
|
|
||||||
workspace: 'src/project/location',
|
|
||||||
tag: 'v0.1'
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information regarding the [action interface please click here](https://github.com/JamesIves/github-pages-deploy-action/blob/dev/src/constants.ts#L7).
|
|
||||||
|
|
||||||
## Configuration 📁
|
## Configuration 📁
|
||||||
|
|
||||||
The `with` portion of the workflow **must** be configured before the action will work. You can add these in the `with` section found in the examples above. Any `secrets` must be referenced using the bracket syntax and stored in the GitHub repository's `Settings/Secrets` menu. You can learn more about setting environment variables with GitHub actions [here](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets).
|
The `with` portion of the workflow **must** be configured before the action will work. You can add these in the `with` section found in the examples above. Any `secrets` must be referenced using the bracket syntax and stored in the GitHub repository's `Settings/Secrets` menu. You can learn more about setting environment variables with GitHub actions [here](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets).
|
||||||
@ -170,7 +132,6 @@ By default, the action does not need any token configuration and uses the provid
|
|||||||
| `single-commit` | This option can be toggled to `true` if you'd prefer to have a single commit on the deployment branch instead of maintaining the full history. **Using this option will also cause any existing history to be wiped from the deployment branch**. | `with` | **No** |
|
| `single-commit` | This option can be toggled to `true` if you'd prefer to have a single commit on the deployment branch instead of maintaining the full history. **Using this option will also cause any existing history to be wiped from the deployment branch**. | `with` | **No** |
|
||||||
| `force` | Force-push new deployments to overwrite the previous version; otherwise, attempt to rebase new deployments onto any existing ones. This option is turned on by default and can be toggled off by setting it to `false`, which may be useful if there are multiple deployments in a single branch. | `with` | **No** |
|
| `force` | Force-push new deployments to overwrite the previous version; otherwise, attempt to rebase new deployments onto any existing ones. This option is turned on by default and can be toggled off by setting it to `false`, which may be useful if there are multiple deployments in a single branch. | `with` | **No** |
|
||||||
| `silent` | Silences the action output preventing it from displaying git messages. | `with` | **No** |
|
| `silent` | Silences the action output preventing it from displaying git messages. | `with` | **No** |
|
||||||
| `workspace` | This should point to where your project lives on the virtual machine. The GitHub Actions environment will set this for you. It is only necessary to set this variable if you're using the node module. | `with` | **No** |
|
|
||||||
| `tag` | Add a tag to the commit. Only works when `dry-run` is not used. | `with` | **No** |
|
| `tag` | Add a tag to the commit. Only works when `dry-run` is not used. | `with` | **No** |
|
||||||
|
|
||||||
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.
|
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.
|
||||||
|
10
action.yml
10
action.yml
@ -2,7 +2,7 @@ name: 'Deploy to GitHub Pages'
|
|||||||
description: 'This action will handle the deployment process of your project to GitHub Pages.'
|
description: 'This action will handle the deployment process of your project to GitHub Pages.'
|
||||||
author: 'James Ives <iam@jamesiv.es>'
|
author: 'James Ives <iam@jamesiv.es>'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'lib/main.js'
|
main: 'lib/main.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'git-commit'
|
icon: 'git-commit'
|
||||||
@ -24,7 +24,7 @@ inputs:
|
|||||||
However if you need more permissions for things such as deploying to another repository, you can add a Personal Access Token (PAT) here.
|
However if you need more permissions for things such as deploying to another repository, you can add a Personal Access Token (PAT) here.
|
||||||
This should be stored in the `secrets / with` menu **as a secret**.
|
This should be stored in the `secrets / with` menu **as a secret**.
|
||||||
|
|
||||||
We recommend using a service account with the least permissions neccersary
|
We recommend using a service account with the least permissions necessary
|
||||||
and when generating a new PAT that you select the least permission scopes required.
|
and when generating a new PAT that you select the least permission scopes required.
|
||||||
|
|
||||||
[Learn more about creating and using encrypted secrets here.](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
|
[Learn more about creating and using encrypted secrets here.](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
|
||||||
@ -58,7 +58,7 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
|
|
||||||
dry-run:
|
dry-run:
|
||||||
description: 'Do not actually push back, but use `--dry-run` on `git push` invocations insead.'
|
description: 'Do not actually push back, but use `--dry-run` on `git push` invocations instead.'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
force:
|
force:
|
||||||
@ -78,10 +78,6 @@ inputs:
|
|||||||
description: 'Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: JamesIves/github-pages-deploy-action'
|
description: 'Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: JamesIves/github-pages-deploy-action'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
workspace:
|
|
||||||
description: "This should point to where your project lives on the virtual machine. The GitHub Actions environment will set this for you. It is only neccersary to set this variable if you're using the node module."
|
|
||||||
required: false
|
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
description: "Add a tag to the commit, this can be used like so: 'v0.1'. Only works when 'dry-run' is not used."
|
description: "Add a tag to the commit, this can be used like so: 'v0.1'. Only works when 'dry-run' is not used."
|
||||||
required: false
|
required: false
|
||||||
|
12
package.json
12
package.json
@ -2,7 +2,7 @@
|
|||||||
"name": "@jamesives/github-pages-deploy-action",
|
"name": "@jamesives/github-pages-deploy-action",
|
||||||
"description": "GitHub action for building a project and deploying it to GitHub pages.",
|
"description": "GitHub action for building a project and deploying it to GitHub pages.",
|
||||||
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
|
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
|
||||||
"version": "4.3.4",
|
"version": "4.4.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "lib/lib.js",
|
"main": "lib/lib.js",
|
||||||
"types": "lib/lib.d.ts",
|
"types": "lib/lib.d.ts",
|
||||||
@ -35,25 +35,25 @@
|
|||||||
"deployment"
|
"deployment"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.9.0",
|
"@actions/core": "1.10.0",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "1.1.1",
|
||||||
"@actions/github": "5.0.3",
|
"@actions/github": "5.1.1",
|
||||||
"@actions/io": "1.1.2"
|
"@actions/io": "1.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "27.5.0",
|
"@types/jest": "27.5.0",
|
||||||
"@types/node": "18.0.6",
|
"@types/node": "18.8.0",
|
||||||
"@typescript-eslint/eslint-plugin": "4.33.0",
|
"@typescript-eslint/eslint-plugin": "4.33.0",
|
||||||
"@typescript-eslint/parser": "4.33.0",
|
"@typescript-eslint/parser": "4.33.0",
|
||||||
"eslint": "7.32.0",
|
"eslint": "7.32.0",
|
||||||
"eslint-config-prettier": "8.5.0",
|
"eslint-config-prettier": "8.5.0",
|
||||||
"eslint-plugin-jest": "26.5.3",
|
"eslint-plugin-jest": "27.0.4",
|
||||||
"eslint-plugin-prettier": "4.2.1",
|
"eslint-plugin-prettier": "4.2.1",
|
||||||
"jest": "26.6.3",
|
"jest": "26.6.3",
|
||||||
"jest-circus": "27.5.1",
|
"jest-circus": "27.5.1",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "3.0.2",
|
||||||
"ts-jest": "26.5.6",
|
"ts-jest": "26.5.6",
|
||||||
"typescript": "4.7.4"
|
"typescript": "4.8.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ export interface ActionInterface {
|
|||||||
name?: string
|
name?: string
|
||||||
/** The repository path, for example JamesIves/github-pages-deploy-action. */
|
/** The repository path, for example JamesIves/github-pages-deploy-action. */
|
||||||
repositoryName?: string
|
repositoryName?: string
|
||||||
/** The fully qualified repositpory path, this gets auto generated if repositoryName is provided. */
|
/** The fully qualified repository path, this gets auto generated if repositoryName is provided. */
|
||||||
repositoryPath?: string
|
repositoryPath?: string
|
||||||
/** Wipes the commit history from the deployment branch in favor of a single commit. */
|
/** Wipes the commit history from the deployment branch in favor of a single commit. */
|
||||||
singleCommit?: boolean | null
|
singleCommit?: boolean | null
|
||||||
|
@ -15,7 +15,9 @@ import {
|
|||||||
suppressSensitiveInformation
|
suppressSensitiveInformation
|
||||||
} from './util'
|
} from './util'
|
||||||
|
|
||||||
/* Initializes git in the workspace. */
|
/**
|
||||||
|
* Initializes git in the workspace.
|
||||||
|
*/
|
||||||
export async function init(action: ActionInterface): Promise<void | Error> {
|
export async function init(action: ActionInterface): Promise<void | Error> {
|
||||||
try {
|
try {
|
||||||
info(`Deploying using ${action.tokenType}… 🔑`)
|
info(`Deploying using ${action.tokenType}… 🔑`)
|
||||||
@ -96,7 +98,9 @@ export async function init(action: ActionInterface): Promise<void | Error> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Runs the necessary steps to make the deployment. */
|
/**
|
||||||
|
* Runs the necessary steps to make the deployment.
|
||||||
|
*/
|
||||||
export async function deploy(action: ActionInterface): Promise<Status> {
|
export async function deploy(action: ActionInterface): Promise<Status> {
|
||||||
const temporaryDeploymentDirectory =
|
const temporaryDeploymentDirectory =
|
||||||
'github-pages-deploy-action-temp-deployment-folder'
|
'github-pages-deploy-action-temp-deployment-folder'
|
||||||
|
@ -5,6 +5,9 @@ import {appendFileSync} from 'fs'
|
|||||||
import {ActionInterface} from './constants'
|
import {ActionInterface} from './constants'
|
||||||
import {extractErrorMessage, suppressSensitiveInformation} from './util'
|
import {extractErrorMessage, suppressSensitiveInformation} from './util'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures SSH for the workflow.
|
||||||
|
*/
|
||||||
export async function configureSSH(action: ActionInterface): Promise<void> {
|
export async function configureSSH(action: ActionInterface): Promise<void> {
|
||||||
try {
|
try {
|
||||||
if (typeof action.sshKey === 'string') {
|
if (typeof action.sshKey === 'string') {
|
||||||
|
41
src/util.ts
41
src/util.ts
@ -8,22 +8,30 @@ import {
|
|||||||
SupportedOperatingSystems
|
SupportedOperatingSystems
|
||||||
} from './constants'
|
} from './constants'
|
||||||
|
|
||||||
/* Replaces all instances of a match in a string. */
|
/**
|
||||||
|
* Replaces all instances of a match in a string.
|
||||||
|
*/
|
||||||
const replaceAll = (input: string, find: string, replace: string): string =>
|
const replaceAll = (input: string, find: string, replace: string): string =>
|
||||||
input.split(find).join(replace)
|
input.split(find).join(replace)
|
||||||
|
|
||||||
/* Utility function that checks to see if a value is undefined or not.
|
/**
|
||||||
If allowEmptyString is passed the parameter is allowed to contain an empty string as a valid parameter. */
|
* Utility function that checks to see if a value is undefined or not.
|
||||||
|
* If allowEmptyString is passed the parameter is allowed to contain an empty string as a valid parameter.
|
||||||
|
*/
|
||||||
export const isNullOrUndefined = (
|
export const isNullOrUndefined = (
|
||||||
value: unknown
|
value: unknown
|
||||||
): value is undefined | null | '' =>
|
): value is undefined | null | '' =>
|
||||||
typeof value === 'undefined' || value === null || value === ''
|
typeof value === 'undefined' || value === null || value === ''
|
||||||
|
|
||||||
/* Generates a token type used for the action. */
|
/**
|
||||||
|
* Generates a token type used for the action.
|
||||||
|
*/
|
||||||
export const generateTokenType = (action: ActionInterface): string =>
|
export const generateTokenType = (action: ActionInterface): string =>
|
||||||
action.sshKey ? 'SSH Deploy Key' : action.token ? 'Deploy Token' : '…'
|
action.sshKey ? 'SSH Deploy Key' : action.token ? 'Deploy Token' : '…'
|
||||||
|
|
||||||
/* Generates a the repository path used to make the commits. */
|
/**
|
||||||
|
* Generates a the repository path used to make the commits.
|
||||||
|
*/
|
||||||
export const generateRepositoryPath = (action: ActionInterface): string =>
|
export const generateRepositoryPath = (action: ActionInterface): string =>
|
||||||
action.sshKey
|
action.sshKey
|
||||||
? `git@${action.hostname}:${action.repositoryName}`
|
? `git@${action.hostname}:${action.repositoryName}`
|
||||||
@ -31,7 +39,9 @@ export const generateRepositoryPath = (action: ActionInterface): string =>
|
|||||||
action.repositoryName
|
action.repositoryName
|
||||||
}.git`
|
}.git`
|
||||||
|
|
||||||
/* Genetate absolute folder path by the provided folder name */
|
/**
|
||||||
|
* Generate absolute folder path by the provided folder name
|
||||||
|
*/
|
||||||
export const generateFolderPath = (action: ActionInterface): string => {
|
export const generateFolderPath = (action: ActionInterface): string => {
|
||||||
const folderName = action['folder']
|
const folderName = action['folder']
|
||||||
return path.isAbsolute(folderName)
|
return path.isAbsolute(folderName)
|
||||||
@ -41,7 +51,9 @@ export const generateFolderPath = (action: ActionInterface): string => {
|
|||||||
: path.join(action.workspace, folderName)
|
: path.join(action.workspace, folderName)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for the required tokens and formatting. Throws an error if any case is matched. */
|
/**
|
||||||
|
* Checks for the required tokens and formatting. Throws an error if any case is matched.
|
||||||
|
*/
|
||||||
const hasRequiredParameters = <K extends keyof RequiredActionParameters>(
|
const hasRequiredParameters = <K extends keyof RequiredActionParameters>(
|
||||||
action: ActionInterface,
|
action: ActionInterface,
|
||||||
params: K[]
|
params: K[]
|
||||||
@ -53,7 +65,9 @@ const hasRequiredParameters = <K extends keyof RequiredActionParameters>(
|
|||||||
return Boolean(nonNullParams.length)
|
return Boolean(nonNullParams.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Verifies the action has the required parameters to run, otherwise throw an error. */
|
/**
|
||||||
|
* Verifies the action has the required parameters to run, otherwise throw an error.
|
||||||
|
*/
|
||||||
export const checkParameters = (action: ActionInterface): void => {
|
export const checkParameters = (action: ActionInterface): void => {
|
||||||
if (!hasRequiredParameters(action, ['token', 'sshKey'])) {
|
if (!hasRequiredParameters(action, ['token', 'sshKey'])) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@ -86,7 +100,9 @@ export const checkParameters = (action: ActionInterface): void => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Suppresses sensitive information from being exposed in error messages. */
|
/**
|
||||||
|
* Suppresses sensitive information from being exposed in error messages.
|
||||||
|
*/
|
||||||
export const suppressSensitiveInformation = (
|
export const suppressSensitiveInformation = (
|
||||||
str: string,
|
str: string,
|
||||||
action: ActionInterface
|
action: ActionInterface
|
||||||
@ -109,6 +125,9 @@ export const suppressSensitiveInformation = (
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extracts message from an error object.
|
||||||
|
*/
|
||||||
export const extractErrorMessage = (error: unknown): string =>
|
export const extractErrorMessage = (error: unknown): string =>
|
||||||
error instanceof Error
|
error instanceof Error
|
||||||
? error.message
|
? error.message
|
||||||
@ -116,6 +135,8 @@ export const extractErrorMessage = (error: unknown): string =>
|
|||||||
? error
|
? error
|
||||||
: JSON.stringify(error)
|
: JSON.stringify(error)
|
||||||
|
|
||||||
/** Strips the protocol from a provided URL. */
|
/**
|
||||||
|
* Strips the protocol from a provided URL.
|
||||||
|
*/
|
||||||
export const stripProtocolFromUrl = (url: string): string =>
|
export const stripProtocolFromUrl = (url: string): string =>
|
||||||
url.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '').split('/')[0]
|
url.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '').split('/')[0]
|
||||||
|
@ -21,7 +21,9 @@ export class GitCheckout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate the worktree and set initial content if it exists */
|
/**
|
||||||
|
* Generate the worktree and set initial content if it exists
|
||||||
|
*/
|
||||||
export async function generateWorktree(
|
export async function generateWorktree(
|
||||||
action: ActionInterface,
|
action: ActionInterface,
|
||||||
worktreedir: string,
|
worktreedir: string,
|
||||||
|
43
yarn.lock
43
yarn.lock
@ -2,12 +2,13 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@actions/core@1.9.0":
|
"@actions/core@1.10.0":
|
||||||
version "1.9.0"
|
version "1.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.9.0.tgz#20c1baac5d4bd2508ba1fc3e5f3fc4b8a80d4082"
|
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f"
|
||||||
integrity sha512-5pbM693Ih59ZdUhgk+fts+bUWTnIdHV3kwOSr+QIoFHMLg7Gzhwm0cifDY/AG68ekEJAkHnQVpcy4f6GjmzBCA==
|
integrity sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/http-client" "^2.0.1"
|
"@actions/http-client" "^2.0.1"
|
||||||
|
uuid "^8.3.2"
|
||||||
|
|
||||||
"@actions/exec@1.1.1":
|
"@actions/exec@1.1.1":
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
@ -16,10 +17,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@actions/io" "^1.0.1"
|
"@actions/io" "^1.0.1"
|
||||||
|
|
||||||
"@actions/github@5.0.3":
|
"@actions/github@5.1.1":
|
||||||
version "5.0.3"
|
version "5.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.0.3.tgz#b305765d6173962d113451ea324ff675aa674f35"
|
resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.1.1.tgz#40b9b9e1323a5efcf4ff7dadd33d8ea51651bbcb"
|
||||||
integrity sha512-myjA/pdLQfhUGLtRZC/J4L1RXOG4o6aYdiEq+zr5wVVKljzbFld+xv10k1FX6IkIJtNxbAq44BdwSNpQ015P0A==
|
integrity sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/http-client" "^2.0.1"
|
"@actions/http-client" "^2.0.1"
|
||||||
"@octokit/core" "^3.6.0"
|
"@octokit/core" "^3.6.0"
|
||||||
@ -1276,10 +1277,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
|
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
|
||||||
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
|
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
|
||||||
|
|
||||||
"@types/node@*", "@types/node@18.0.6", "@types/node@>= 8":
|
"@types/node@*", "@types/node@18.8.0", "@types/node@>= 8":
|
||||||
version "18.0.6"
|
version "18.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.6.tgz#0ba49ac517ad69abe7a1508bc9b3a5483df9d5d7"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.8.0.tgz#b8ee8d83a99470c0661bd899417fcd77060682fe"
|
||||||
integrity sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw==
|
integrity sha512-u+h43R6U8xXDt2vzUaVP3VwjjLyOJk6uEciZS8OSyziUQGOwmk+l+4drxcsDboHXwyTaqS1INebghmWMRxq3LA==
|
||||||
|
|
||||||
"@types/normalize-package-data@^2.4.0":
|
"@types/normalize-package-data@^2.4.0":
|
||||||
version "2.4.0"
|
version "2.4.0"
|
||||||
@ -2145,10 +2146,10 @@ eslint-config-prettier@8.5.0:
|
|||||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
|
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
|
||||||
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
|
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
|
||||||
|
|
||||||
eslint-plugin-jest@26.5.3:
|
eslint-plugin-jest@27.0.4:
|
||||||
version "26.5.3"
|
version "27.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.5.3.tgz#a3ceeaf4a757878342b8b00eca92379b246e5505"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.0.4.tgz#ab9c7b3f48bfade4762c24c415a5d9bbc0174a61"
|
||||||
integrity sha512-sICclUqJQnR1bFRZGLN2jnSVsYOsmPYYnroGCIMVSvTS3y8XR3yjzy1EcTQmk6typ5pRgyIWzbjqxK6cZHEZuQ==
|
integrity sha512-BuvY78pHMpMJ6Cio7sKg6jrqEcnRYPUc4Nlihku4vKx3FjlmMINSX4vcYokZIe+8TKcyr1aI5Kq7vYwgJNdQSA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@typescript-eslint/utils" "^5.10.0"
|
"@typescript-eslint/utils" "^5.10.0"
|
||||||
|
|
||||||
@ -4745,10 +4746,10 @@ typedarray-to-buffer@^3.1.5:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-typedarray "^1.0.0"
|
is-typedarray "^1.0.0"
|
||||||
|
|
||||||
typescript@4.7.4:
|
typescript@4.8.4:
|
||||||
version "4.7.4"
|
version "4.8.4"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
|
||||||
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
|
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
|
||||||
|
|
||||||
union-value@^1.0.0:
|
union-value@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
@ -4802,7 +4803,7 @@ use@^3.1.0:
|
|||||||
version "3.1.1"
|
version "3.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
|
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
|
||||||
|
|
||||||
uuid@^8.3.0:
|
uuid@^8.3.0, uuid@^8.3.2:
|
||||||
version "8.3.2"
|
version "8.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user