Skip to content

Commit 09a5452

Browse files
committed
docs: Updated docs to remove workspace
1 parent b7b8bb2 commit 09a5452

File tree

7 files changed

+46
-21
lines changed

7 files changed

+46
-21
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ By default, the action does not need any token configuration and uses the provid
132132
| `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** |
133133
| `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** |
134134
| `silent` | Silences the action output preventing it from displaying git messages. | `with` | **No** |
135-
| `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** |
136135
| `tag` | Add a tag to the commit. Only works when `dry-run` is not used. | `with` | **No** |
137136

138137
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.

action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inputs:
2424
However if you need more permissions for things such as deploying to another repository, you can add a Personal Access Token (PAT) here.
2525
This should be stored in the `secrets / with` menu **as a secret**.
2626
27-
We recommend using a service account with the least permissions neccersary
27+
We recommend using a service account with the least permissions necessary
2828
and when generating a new PAT that you select the least permission scopes required.
2929
3030
[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:
5858
required: false
5959

6060
dry-run:
61-
description: 'Do not actually push back, but use `--dry-run` on `git push` invocations insead.'
61+
description: 'Do not actually push back, but use `--dry-run` on `git push` invocations instead.'
6262
required: false
6363

6464
force:
@@ -78,10 +78,6 @@ inputs:
7878
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'
7979
required: false
8080

81-
workspace:
82-
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."
83-
required: false
84-
8581
tag:
8682
description: "Add a tag to the commit, this can be used like so: 'v0.1'. Only works when 'dry-run' is not used."
8783
required: false

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface ActionInterface {
4242
name?: string
4343
/** The repository path, for example JamesIves/github-pages-deploy-action. */
4444
repositoryName?: string
45-
/** The fully qualified repositpory path, this gets auto generated if repositoryName is provided. */
45+
/** The fully qualified repository path, this gets auto generated if repositoryName is provided. */
4646
repositoryPath?: string
4747
/** Wipes the commit history from the deployment branch in favor of a single commit. */
4848
singleCommit?: boolean | null

src/git.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import {
1515
suppressSensitiveInformation
1616
} from './util'
1717

18-
/* Initializes git in the workspace. */
18+
/**
19+
* Initializes git in the workspace.
20+
*/
1921
export async function init(action: ActionInterface): Promise<void | Error> {
2022
try {
2123
info(`Deploying using ${action.tokenType}… 🔑`)
@@ -96,7 +98,9 @@ export async function init(action: ActionInterface): Promise<void | Error> {
9698
}
9799
}
98100

99-
/* Runs the necessary steps to make the deployment. */
101+
/**
102+
* Runs the necessary steps to make the deployment.
103+
*/
100104
export async function deploy(action: ActionInterface): Promise<Status> {
101105
const temporaryDeploymentDirectory =
102106
'github-pages-deploy-action-temp-deployment-folder'

src/ssh.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import {appendFileSync} from 'fs'
55
import {ActionInterface} from './constants'
66
import {extractErrorMessage, suppressSensitiveInformation} from './util'
77

8+
/**
9+
* Configures SSH for the workflow.
10+
*/
811
export async function configureSSH(action: ActionInterface): Promise<void> {
912
try {
1013
if (typeof action.sshKey === 'string') {

src/util.ts

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,40 @@ import {
88
SupportedOperatingSystems
99
} from './constants'
1010

11-
/* Replaces all instances of a match in a string. */
11+
/**
12+
* Replaces all instances of a match in a string.
13+
*/
1214
const replaceAll = (input: string, find: string, replace: string): string =>
1315
input.split(find).join(replace)
1416

15-
/* Utility function that checks to see if a value is undefined or not.
16-
If allowEmptyString is passed the parameter is allowed to contain an empty string as a valid parameter. */
17+
/**
18+
* Utility function that checks to see if a value is undefined or not.
19+
* If allowEmptyString is passed the parameter is allowed to contain an empty string as a valid parameter.
20+
*/
1721
export const isNullOrUndefined = (
1822
value: unknown
1923
): value is undefined | null | '' =>
2024
typeof value === 'undefined' || value === null || value === ''
2125

22-
/* Generates a token type used for the action. */
26+
/**
27+
* Generates a token type used for the action.
28+
*/
2329
export const generateTokenType = (action: ActionInterface): string =>
2430
action.sshKey ? 'SSH Deploy Key' : action.token ? 'Deploy Token' : '…'
2531

26-
/* Generates a the repository path used to make the commits. */
32+
/**
33+
* Generates a the repository path used to make the commits.
34+
*/
2735
export const generateRepositoryPath = (action: ActionInterface): string =>
2836
action.sshKey
2937
? `git@${action.hostname}:${action.repositoryName}`
3038
: `https://${`x-access-token:${action.token}`}@${action.hostname}/${
3139
action.repositoryName
3240
}.git`
3341

34-
/* Genetate absolute folder path by the provided folder name */
42+
/**
43+
* Generate absolute folder path by the provided folder name
44+
*/
3545
export const generateFolderPath = (action: ActionInterface): string => {
3646
const folderName = action['folder']
3747
return path.isAbsolute(folderName)
@@ -41,7 +51,9 @@ export const generateFolderPath = (action: ActionInterface): string => {
4151
: path.join(action.workspace, folderName)
4252
}
4353

44-
/* Checks for the required tokens and formatting. Throws an error if any case is matched. */
54+
/**
55+
* Checks for the required tokens and formatting. Throws an error if any case is matched.
56+
*/
4557
const hasRequiredParameters = <K extends keyof RequiredActionParameters>(
4658
action: ActionInterface,
4759
params: K[]
@@ -53,7 +65,9 @@ const hasRequiredParameters = <K extends keyof RequiredActionParameters>(
5365
return Boolean(nonNullParams.length)
5466
}
5567

56-
/* Verifies the action has the required parameters to run, otherwise throw an error. */
68+
/**
69+
* Verifies the action has the required parameters to run, otherwise throw an error.
70+
*/
5771
export const checkParameters = (action: ActionInterface): void => {
5872
if (!hasRequiredParameters(action, ['token', 'sshKey'])) {
5973
throw new Error(
@@ -86,7 +100,9 @@ export const checkParameters = (action: ActionInterface): void => {
86100
}
87101
}
88102

89-
/* Suppresses sensitive information from being exposed in error messages. */
103+
/**
104+
* Suppresses sensitive information from being exposed in error messages.
105+
*/
90106
export const suppressSensitiveInformation = (
91107
str: string,
92108
action: ActionInterface
@@ -109,13 +125,18 @@ export const suppressSensitiveInformation = (
109125
return value
110126
}
111127

128+
/**
129+
* Extracts message from an error object.
130+
*/
112131
export const extractErrorMessage = (error: unknown): string =>
113132
error instanceof Error
114133
? error.message
115134
: typeof error == 'string'
116135
? error
117136
: JSON.stringify(error)
118137

119-
/** Strips the protocol from a provided URL. */
138+
/**
139+
* Strips the protocol from a provided URL.
140+
*/
120141
export const stripProtocolFromUrl = (url: string): string =>
121142
url.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '').split('/')[0]

src/worktree.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export class GitCheckout {
2121
}
2222
}
2323

24-
/* Generate the worktree and set initial content if it exists */
24+
/**
25+
* Generate the worktree and set initial content if it exists
26+
*/
2527
export async function generateWorktree(
2628
action: ActionInterface,
2729
worktreedir: string,

0 commit comments

Comments
 (0)