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/v3
This commit is contained in:
commit
530892af9e
14
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
14
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
@ -7,19 +7,13 @@ labels:
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
> Please provide a clear and concise description of what the bug is.
|
||||
<!-- Please provide a clear and concise description of what the bug is. -->
|
||||
|
||||
**Reproduce**
|
||||
|
||||
> Steps to reproduce the behavior.
|
||||
|
||||
<!-- Steps to reproduce the behavior. -->
|
||||
|
||||
**Logs**
|
||||
|
||||
> Please provide your deployment logs and a link to your workflow file.
|
||||
|
||||
<!-- Please provide your deployment logs and a link or sample to/of your workflow. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
|
||||
|
||||
**Additional Comments**
|
||||
|
||||
> Add any other context about the problem here.
|
||||
<!--Add any other context about the problem here. -->
|
||||
|
9
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
9
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
vendored
@ -7,13 +7,10 @@ labels:
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
|
||||
> Please provide a clear and concise description of what the problem is.
|
||||
<!-- Please provide a clear and concise description of what the problem is. Please be sure to read the README first! -->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
|
||||
> Please provide a clear and concise description of what you want to happen.
|
||||
<!-- Please provide a clear and concise description of what you want to happen. -->
|
||||
|
||||
**Additional Comments**
|
||||
|
||||
> Add any other context about the feature request here.
|
||||
<!-- Add any other context about the feature request here. -->
|
||||
|
10
.github/ISSUE_TEMPLATE/SUPPORT.md
vendored
10
.github/ISSUE_TEMPLATE/SUPPORT.md
vendored
@ -7,14 +7,10 @@ labels:
|
||||
---
|
||||
|
||||
**Describe the Issue**
|
||||
|
||||
> Please provide a clear and concise description of what the problem is.
|
||||
<!-- Please provide a clear and concise description of what the problem is. Please be sure to read the README first! -->
|
||||
|
||||
**Logs**
|
||||
|
||||
> Please provide your deployment logs and a link to your workflow file.
|
||||
|
||||
<!-- Please provide your deployment logs and a link or sample to/of your workflow. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
|
||||
|
||||
**Additional Comments**
|
||||
|
||||
> Add any other context about the issue here.
|
||||
<!-- Add any other context about the issue here. -->
|
||||
|
10
.github/workflows/integration-beta.yml
vendored
10
.github/workflows/integration-beta.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
BRANCH: gh-pages-test
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma
|
||||
TARGET_FOLDER: cat/montezuma
|
||||
GIT_CONFIG_NAME: Montezuma
|
||||
GIT_CONFIG_EMAIL: montezuma@jamesiv.es
|
||||
|
||||
@ -50,7 +50,7 @@ jobs:
|
||||
BRANCH: gh-pages-test
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma2
|
||||
TARGET_FOLDER: cat/montezuma2
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
@ -84,7 +84,7 @@ jobs:
|
||||
BRANCH: gh-pages-test
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma2
|
||||
TARGET_FOLDER: cat/montezuma2
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
@ -115,7 +115,7 @@ jobs:
|
||||
BRANCH: gh-pages-test
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma3
|
||||
TARGET_FOLDER: cat/montezuma3
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
@ -150,7 +150,7 @@ jobs:
|
||||
BRANCH: gh-pages-test
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma4
|
||||
TARGET_FOLDER: cat/montezuma4
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
|
10
.github/workflows/integration.yml
vendored
10
.github/workflows/integration.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
||||
BRANCH: gh-pages
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma
|
||||
TARGET_FOLDER: cat/montezuma
|
||||
GIT_CONFIG_NAME: Montezuma
|
||||
GIT_CONFIG_EMAIL: montezuma@jamesiv.es
|
||||
|
||||
@ -51,7 +51,7 @@ jobs:
|
||||
BRANCH: gh-pages
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma2
|
||||
TARGET_FOLDER: cat/montezuma2
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
@ -85,7 +85,7 @@ jobs:
|
||||
BRANCH: gh-pages
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma2
|
||||
TARGET_FOLDER: cat/montezuma2
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
@ -115,7 +115,7 @@ jobs:
|
||||
BRANCH: gh-pages
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma3
|
||||
TARGET_FOLDER: cat/montezuma3
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
@ -149,7 +149,7 @@ jobs:
|
||||
BRANCH: gh-pages
|
||||
FOLDER: integration
|
||||
BASE_BRANCH: dev
|
||||
TARGET_FOLDER: montezuma4
|
||||
TARGET_FOLDER: cat/montezuma4
|
||||
|
||||
- name: Cleanup Generated Branch
|
||||
uses: dawidd6/action-delete-branch@v2.0.1
|
||||
|
20
README.md
20
README.md
@ -115,7 +115,7 @@ For more information regarding the [action interface please click here](https://
|
||||
|
||||
## 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 repositories `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).
|
||||
|
||||
#### Required Setup
|
||||
|
||||
@ -123,9 +123,9 @@ One of the following deployment options must be configured.
|
||||
|
||||
| Key | Value Information | Type | Required |
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -------- |
|
||||
| `GITHUB_TOKEN` | In order for GitHub to trigger the rebuild of your page you must provide the action with the repository's provided GitHub token. This can be referenced in the workflow `yml` file by using `${{ secrets.GITHUB_TOKEN }}`. If you experience any issues with your changes not being reflected after the deployment it may be neccersary to use either the `SSH` or `ACCESS_TOKEN` options. | `secrets / with` | **Yes** |
|
||||
| `SSH` | You can configure the action to deploy using SSH by setting this option to `true`. For more information on how to add your ssh key pair please refer to the [Using a Deploy Key section of this README](https://github.com/JamesIves/github-pages-deploy-action/tree/dev#using-an-ssh-deploy-key-). | `with` | **Yes** |
|
||||
| `ACCESS_TOKEN` | Depending on the repository permissions you may need to provide the action with a GitHub personal access token instead of the provided GitHub token in order to deploy. You can [learn more about how to generate one here](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line). **This should be stored as a secret**. | `secrets / with` | **Yes** |
|
||||
| `GITHUB_TOKEN` | In order for GitHub to trigger the rebuild of your page you must provide the action with the repositories provided GitHub token. This can be referenced in the workflow `yml` file by using `${{ secrets.GITHUB_TOKEN }}`. **Please note there is currently an issue affecting the use of this token which makes it so it only works with private repositories, [you can learn more here](https://github.com/JamesIves/github-pages-deploy-action/issues/5)**. | `secrets / with` | **Yes** |
|
||||
| `ACCESS_TOKEN` | Depending on the repository's permissions you may need to provide the action with a GitHub personal access token instead of the provided GitHub token in order to deploy. You can [learn more about how to generate one here](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line). **This should be stored as a secret**. | `secrets / with` | **Yes** |
|
||||
|
||||
In addition to the deployment options you must also configure the following.
|
||||
|
||||
@ -140,7 +140,7 @@ In addition to the deployment options you must also configure the following.
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
|
||||
| `GIT_CONFIG_NAME` | Allows you to customize the name that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the name in the GitHub context, followed by the name of the action. | `with` | **No** |
|
||||
| `GIT_CONFIG_EMAIL` | Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. | `with` | **No** |
|
||||
| `REPOSITORY_NAME` | Allows you to speicfy 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`. | `with` | **No** |
|
||||
| `REPOSITORY_NAME` | 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`. | `with` | **No** |
|
||||
| `TARGET_FOLDER` | If you'd like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here. | `with` | **No** |
|
||||
| `BASE_BRANCH` | The base branch of your repository which you'd like to checkout prior to deploying. This defaults to the current commit [SHA](http://en.wikipedia.org/wiki/SHA-1) that triggered the build followed by `master` if it doesn't exist. This is useful for making deployments from another branch, and also may be necessary when using a scheduled job. | `with` | **No** |
|
||||
| `COMMIT_MESSAGE` | If you need to customize the commit message for an integration you can do so. | `with` | **No** |
|
||||
@ -151,6 +151,16 @@ In addition to the deployment options you must also configure the following.
|
||||
|
||||
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.
|
||||
|
||||
#### Deployment Status
|
||||
|
||||
The action will export an environment variable called `DEPLOYMENT_STATUS` that you can use in your workflow to determine if the deployment was successful or not. You can find an explanation of each status code below.
|
||||
|
||||
| Status | Description |
|
||||
| ------------- |:-------------:|
|
||||
| `success` | The `success` status indicates that the action was able to successfully deploy the project to the branch. |
|
||||
| `failed` | The `failed` status indicates that the action encountered an error while trying to deploy the project. |
|
||||
| `skipped` | The `skipped` status indicates that the action exited early as there was nothing new to deploy. |
|
||||
|
||||
---
|
||||
|
||||
### Using an SSH Deploy Key 🔑
|
||||
@ -161,7 +171,7 @@ If you'd prefer to use an SSH deploy key as opposed to a token you must first ge
|
||||
ssh-keygen -t rsa -b 4096 -C "youremailhere@example.com" -N ""
|
||||
```
|
||||
|
||||
Once you've generated the key pair you must add the contents of the public key within your repositories [deploy keys menu](https://developer.github.com/v3/guides/managing-deploy-keys/). You can find this option by going to `Settings > Deploy Keys`, you can name the public key whatever you want, but you **do** need to give it write access. Afterwards add the contents of the private key to the `Settings > Secrets` menu as `DEPLOY_KEY`.
|
||||
Once you've generated the key pair you must add the contents of the public key within your repository's [deploy keys menu](https://developer.github.com/v3/guides/managing-deploy-keys/). You can find this option by going to `Settings > Deploy Keys`, you can name the public key whatever you want, but you **do** need to give it write access. Afterwards add the contents of the private key to the `Settings > Secrets` menu as `DEPLOY_KEY`.
|
||||
|
||||
With this configured you must add the `ssh-agent` step to your workflow and set `SSH` to `true` within the deploy action. There are several SSH actions available on the [GitHub marketplace](https://github.com/marketplace?type=actions) for you to choose from.
|
||||
|
||||
|
14
SECURITY.md
Normal file
14
SECURITY.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
The current versions are actively maintained and will receieve frequent updates and security patches.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 3.0.x | :white_check_mark: |
|
||||
| < 2.0 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please disclose any security vulnerabilities either through the issues interface (as a bug) or by [emailing the project maintainer](https://jamesiv.es).
|
@ -81,6 +81,27 @@ describe('git', () => {
|
||||
})
|
||||
|
||||
it('should fail if there is no provided GitHub Token, Access Token or SSH bool', async () => {
|
||||
Object.assign(action, {
|
||||
repositoryPath: null,
|
||||
folder: 'build',
|
||||
branch: 'branch',
|
||||
pusher: {
|
||||
name: 'asd',
|
||||
email: 'as@cat'
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
await init(action)
|
||||
} catch (e) {
|
||||
expect(execute).toBeCalledTimes(0)
|
||||
expect(e.message).toMatch(
|
||||
'There was an error initializing the repository: No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true. ❌'
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
it('should fail if access token is defined but it is an empty string', async () => {
|
||||
Object.assign(action, {
|
||||
repositoryPath: null,
|
||||
folder: 'build',
|
||||
@ -89,9 +110,7 @@ describe('git', () => {
|
||||
name: 'asd',
|
||||
email: 'as@cat'
|
||||
},
|
||||
gitHubToken: null,
|
||||
accessToken: null,
|
||||
ssh: null
|
||||
accessToken: ''
|
||||
})
|
||||
|
||||
try {
|
||||
|
@ -8,7 +8,7 @@ import {action} from '../src/constants'
|
||||
import run from '../src/lib'
|
||||
import {execute} from '../src/execute'
|
||||
import {rmRF} from '@actions/io'
|
||||
import {setFailed} from '@actions/core'
|
||||
import {setFailed, exportVariable} from '@actions/core'
|
||||
|
||||
const originalAction = JSON.stringify(action)
|
||||
|
||||
@ -49,6 +49,24 @@ describe('main', () => {
|
||||
await run(action)
|
||||
expect(execute).toBeCalledTimes(18)
|
||||
expect(rmRF).toBeCalledTimes(1)
|
||||
expect(exportVariable).toBeCalledTimes(1)
|
||||
})
|
||||
|
||||
it('should run through the commands and succeed', async () => {
|
||||
Object.assign(action, {
|
||||
repositoryPath: 'JamesIves/github-pages-deploy-action',
|
||||
folder: 'build',
|
||||
branch: 'branch',
|
||||
gitHubToken: '123',
|
||||
pusher: {
|
||||
name: 'asd',
|
||||
email: 'as@cat'
|
||||
}
|
||||
})
|
||||
await run(action)
|
||||
expect(execute).toBeCalledTimes(17)
|
||||
expect(rmRF).toBeCalledTimes(1)
|
||||
expect(exportVariable).toBeCalledTimes(1)
|
||||
})
|
||||
|
||||
it('should throw if an error is encountered', async () => {
|
||||
@ -68,5 +86,6 @@ describe('main', () => {
|
||||
await run(action)
|
||||
expect(execute).toBeCalledTimes(0)
|
||||
expect(setFailed).toBeCalledTimes(1)
|
||||
expect(exportVariable).toBeCalledTimes(1)
|
||||
})
|
||||
})
|
||||
|
@ -73,7 +73,7 @@ describe('util', () => {
|
||||
accessToken: null,
|
||||
ssh: null
|
||||
}
|
||||
expect(generateTokenType(action)).toEqual('...')
|
||||
expect(generateTokenType(action)).toEqual('…')
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -66,4 +66,8 @@ inputs:
|
||||
|
||||
SINGLE_COMMIT:
|
||||
description: "This option can be used if you'd prefer to have a single commit on the deployment branch instead of maintaining the full history."
|
||||
required: false
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
DEPLOYMENT_STATUS:
|
||||
description: 'The status of the deployment that indicates if the run failed or passed. Possible outputs include: success|failed|skipped'
|
22
package.json
22
package.json
@ -2,7 +2,7 @@
|
||||
"name": "github-pages-deploy-action",
|
||||
"description": "GitHub action for building a project and deploying it to GitHub pages.",
|
||||
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
|
||||
"version": "3.4.8",
|
||||
"version": "3.4.9",
|
||||
"license": "MIT",
|
||||
"main": "lib/lib.js",
|
||||
"types": "lib/lib.d.ts",
|
||||
@ -33,22 +33,22 @@
|
||||
"deployment"
|
||||
],
|
||||
"dependencies": {
|
||||
"@actions/core": "1.2.3",
|
||||
"@actions/core": "1.2.4",
|
||||
"@actions/exec": "1.0.4",
|
||||
"@actions/github": "2.1.1",
|
||||
"@actions/github": "2.2.0",
|
||||
"@actions/io": "1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "25.2.1",
|
||||
"@types/node": "13.13.4",
|
||||
"eslint": "6.8.0",
|
||||
"@types/jest": "25.2.2",
|
||||
"@types/node": "14.0.1",
|
||||
"eslint": "7.0.0",
|
||||
"eslint-plugin-github": "3.4.1",
|
||||
"eslint-plugin-jest": "23.8.2",
|
||||
"eslint-plugin-jest": "23.11.0",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"jest": "25.5.0",
|
||||
"jest-circus": "25.5.1",
|
||||
"jest": "25.5.4",
|
||||
"jest-circus": "26.0.1",
|
||||
"prettier": "2.0.5",
|
||||
"ts-jest": "25.4.0",
|
||||
"typescript": "3.8.3"
|
||||
"ts-jest": "25.5.1",
|
||||
"typescript": "3.9.2"
|
||||
}
|
||||
}
|
||||
|
@ -93,3 +93,11 @@ export const action: ActionInterface = {
|
||||
targetFolder: getInput('TARGET_FOLDER'),
|
||||
workspace: process.env.GITHUB_WORKSPACE || ''
|
||||
}
|
||||
|
||||
/** Status codes for the action. */
|
||||
export enum Status {
|
||||
SUCCESS = 'success',
|
||||
FAILED = 'failed',
|
||||
SKIPPED = 'skipped',
|
||||
RUNNING = 'running'
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {info} from '@actions/core'
|
||||
import {rmRF, mkdirP} from '@actions/io'
|
||||
import {ActionInterface} from './constants'
|
||||
import {ActionInterface, Status} from './constants'
|
||||
import {execute} from './execute'
|
||||
import {
|
||||
hasRequiredParameters,
|
||||
@ -92,7 +92,7 @@ export async function generateBranch(action: ActionInterface): Promise<void> {
|
||||
}
|
||||
|
||||
/* Runs the necessary steps to make the deployment. */
|
||||
export async function deploy(action: ActionInterface): Promise<void> {
|
||||
export async function deploy(action: ActionInterface): Promise<Status> {
|
||||
const temporaryDeploymentDirectory = 'gh-action-temp-deployment-folder'
|
||||
const temporaryDeploymentBranch = 'gh-action-temp-deployment-branch'
|
||||
|
||||
@ -179,8 +179,7 @@ export async function deploy(action: ActionInterface): Promise<void> {
|
||||
)
|
||||
|
||||
if (!hasFilesToCommit && !action.isTest) {
|
||||
info('There is nothing to commit. Exiting early… 📭')
|
||||
return
|
||||
return Status.SKIPPED
|
||||
}
|
||||
|
||||
// Commits to GitHub.
|
||||
@ -236,6 +235,8 @@ export async function deploy(action: ActionInterface): Promise<void> {
|
||||
`git checkout --progress --force ${action.defaultBranch}`,
|
||||
action.workspace
|
||||
)
|
||||
|
||||
return Status.SUCCESS
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`The deploy step encountered an error: ${suppressSensitiveInformation(
|
||||
|
19
src/lib.ts
19
src/lib.ts
@ -1,5 +1,5 @@
|
||||
import {info, setFailed} from '@actions/core'
|
||||
import {action, ActionInterface} from './constants'
|
||||
import {exportVariable, info, setFailed} from '@actions/core'
|
||||
import {action, ActionInterface, Status} from './constants'
|
||||
import {deploy, generateBranch, init} from './git'
|
||||
import {generateRepositoryPath, generateTokenType} from './util'
|
||||
|
||||
@ -10,7 +10,7 @@ import {generateRepositoryPath, generateTokenType} from './util'
|
||||
export default async function run(
|
||||
configuration: ActionInterface
|
||||
): Promise<void> {
|
||||
let errorState = false
|
||||
let status: Status = Status.RUNNING
|
||||
|
||||
try {
|
||||
info('Checking configuration and starting deployment… 🚦')
|
||||
@ -25,18 +25,23 @@ export default async function run(
|
||||
settings.tokenType = generateTokenType(settings)
|
||||
|
||||
await init(settings)
|
||||
await deploy(settings)
|
||||
status = await deploy(settings)
|
||||
} catch (error) {
|
||||
errorState = true
|
||||
status = Status.FAILED
|
||||
setFailed(error.message)
|
||||
} finally {
|
||||
console.log(status)
|
||||
info(
|
||||
`${
|
||||
errorState
|
||||
status === Status.FAILED
|
||||
? 'Deployment Failed ❌'
|
||||
: 'Completed Deployment Successfully! ✅'
|
||||
: status === Status.SUCCESS
|
||||
? 'Completed Deployment Successfully! ✅'
|
||||
: 'There is nothing to commit. Exiting early… 📭'
|
||||
}`
|
||||
)
|
||||
|
||||
exportVariable('DEPLOYMENT_STATUS', status)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ export const generateTokenType = (action: ActionInterface): string =>
|
||||
? 'Access Token'
|
||||
: action.gitHubToken
|
||||
? 'GitHub Token'
|
||||
: '...'
|
||||
: '…'
|
||||
|
||||
/* Generates a the repository path used to make the commits. */
|
||||
export const generateRepositoryPath = (action: ActionInterface): string =>
|
||||
@ -29,7 +29,8 @@ export const hasRequiredParameters = (action: ActionInterface): void => {
|
||||
(isNullOrUndefined(action.accessToken) &&
|
||||
isNullOrUndefined(action.gitHubToken) &&
|
||||
isNullOrUndefined(action.ssh)) ||
|
||||
isNullOrUndefined(action.repositoryPath)
|
||||
isNullOrUndefined(action.repositoryPath) ||
|
||||
(action.accessToken && action.accessToken === '')
|
||||
) {
|
||||
throw new Error(
|
||||
'No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true.'
|
||||
|
Loading…
Reference in New Issue
Block a user