Skip to content

Commit a5c6b46

Browse files
committed
gitHubRepository -> repositoryName
1 parent 44fad04 commit a5c6b46

File tree

7 files changed

+33
-32
lines changed

7 files changed

+33
-32
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ Calling the functions directly will require you to pass in an object containing
6666
import run from "github-pages-deploy-action";
6767

6868
run({
69-
folder: "build",
69+
accessToken: process.env["ACCESS_TOKEN"],
7070
branch: "gh-pages",
71+
folder: "build",
72+
repositoryName: "JamesIves/github-pages-deploy-action",
7173
workspace: "src/project/location",
72-
accessToken: process.env["ACCESS_TOKEN"]
7374
});
7475
```
7576

@@ -102,7 +103,7 @@ In addition to the deployment options you must also configure the following.
102103
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
103104
| `GIT_CONFIG_NAME` | Allows you to customize the name that is attached to the GitHub 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** |
104105
| `GIT_CONFIG_EMAIL` | Allows you to customize the email that is attached to the GitHub 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** |
105-
| `REPOSITORY_PATH` | Allows you to speicfy a different repository path so long as you have permissions to push to it. This shoul be formatted like so: `JamesIves/github-pages-deploy-action`. | `with` | **No** |
106+
| `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** |
106107
| `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** |
107108
| `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** |
108109
| `COMMIT_MESSAGE` | If you need to customize the commit message for an integration you can do so. | `with` | **No** |

__tests__/util.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe("util", () => {
8080
describe("generateRepositoryPath", () => {
8181
it("should return ssh if ssh is provided", async () => {
8282
const action = {
83-
gitHubRepository: "JamesIves/github-pages-deploy-action",
83+
repositoryName: "JamesIves/github-pages-deploy-action",
8484
branch: "123",
8585
root: ".",
8686
workspace: "src/",
@@ -96,7 +96,7 @@ describe("util", () => {
9696

9797
it("should return https if access token is provided", async () => {
9898
const action = {
99-
gitHubRepository: "JamesIves/github-pages-deploy-action",
99+
repositoryName: "JamesIves/github-pages-deploy-action",
100100
branch: "123",
101101
root: ".",
102102
workspace: "src/",
@@ -112,7 +112,7 @@ describe("util", () => {
112112

113113
it("should return https with x-access-token if github token is provided", async () => {
114114
const action = {
115-
gitHubRepository: "JamesIves/github-pages-deploy-action",
115+
repositoryName: "JamesIves/github-pages-deploy-action",
116116
branch: "123",
117117
root: ".",
118118
workspace: "src/",
@@ -129,7 +129,7 @@ describe("util", () => {
129129
describe("suppressSensitiveInformation", () => {
130130
it("should replace any sensitive information with ***", async () => {
131131
const action = {
132-
gitHubRepository: "JamesIves/github-pages-deploy-action",
132+
repositoryName: "JamesIves/github-pages-deploy-action",
133133
repositoryPath:
134134
"https://x-access-token:supersecret999%%%@github.com/anothersecret123333",
135135
branch: "123",
@@ -148,7 +148,7 @@ describe("util", () => {
148148

149149
it("should not suppress information when in debug mode", async () => {
150150
const action = {
151-
gitHubRepository: "JamesIves/github-pages-deploy-action",
151+
repositoryName: "JamesIves/github-pages-deploy-action",
152152
repositoryPath:
153153
"https://x-access-token:supersecret999%%%@github.com/anothersecret123333",
154154
branch: "123",

lib/constants.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ export interface actionInterface {
1919
email?: string;
2020
/** The folder to deploy. */
2121
folder: string;
22-
/** The repository path, for example JamesIves/github-pages-deploy-action */
23-
gitHubRepository?: string;
2422
/** GitHub deployment token. */
2523
gitHubToken?: string | null;
2624
/** Determines if the action is running in test mode or not. */
2725
isTest?: string | undefined | null;
2826
/** The git config name. */
2927
name?: string;
30-
/** The fully qualified repositpory path, this gets auto generated if gitHubRepository is provided. */
28+
/** The repository path, for example JamesIves/github-pages-deploy-action */
29+
repositoryName?: string;
30+
/** The fully qualified repositpory path, this gets auto generated if repositoryName is provided. */
3131
repositoryPath?: string;
3232
/** The root directory where your project lives. */
3333
root?: string;

lib/constants.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ exports.action = {
3030
? pusher.email
3131
: `${process.env.GITHUB_ACTOR ||
3232
"github-pages-deploy-action"}@users.noreply.github.com`,
33-
gitHubRepository: !util_1.isNullOrUndefined(core_1.getInput("REPOSITORY_PATH"))
34-
? core_1.getInput("REPOSITORY_PATH")
35-
: repository && repository.full_name
36-
? repository.full_name
37-
: process.env.GITHUB_REPOSITORY,
3833
gitHubToken: core_1.getInput("GITHUB_TOKEN"),
3934
name: !util_1.isNullOrUndefined(core_1.getInput("GIT_CONFIG_NAME"))
4035
? core_1.getInput("GIT_CONFIG_NAME")
@@ -43,7 +38,12 @@ exports.action = {
4338
: process.env.GITHUB_ACTOR
4439
? process.env.GITHUB_ACTOR
4540
: "GitHub Pages Deploy Action",
41+
repositoryName: !util_1.isNullOrUndefined(core_1.getInput("REPOSITORY_NAME"))
42+
? core_1.getInput("REPOSITORY_NAME")
43+
: repository && repository.full_name
44+
? repository.full_name
45+
: process.env.GITHUB_REPOSITORY,
46+
root: ".",
4647
targetFolder: core_1.getInput("TARGET_FOLDER"),
47-
workspace: process.env.GITHUB_WORKSPACE || "",
48-
root: "."
48+
workspace: process.env.GITHUB_WORKSPACE || ""
4949
};

lib/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ exports.generateTokenType = (action) => action.ssh
1313
: "...";
1414
/* Generates a the repository path used to make the commits. */
1515
exports.generateRepositoryPath = (action) => action.ssh
16-
? `git@github.com:${action.gitHubRepository}`
16+
? `git@github.com:${action.repositoryName}`
1717
: `https://${action.accessToken ||
18-
`x-access-token:${action.gitHubToken}`}@github.com/${action.gitHubRepository}.git`;
18+
`x-access-token:${action.gitHubToken}`}@github.com/${action.repositoryName}.git`;
1919
/* Checks for the required tokens and formatting. Throws an error if any case is matched. */
2020
exports.hasRequiredParameters = (action) => {
2121
if ((exports.isNullOrUndefined(action.accessToken) &&

src/constants.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ export interface actionInterface {
2626
email?: string;
2727
/** The folder to deploy. */
2828
folder: string;
29-
/** The repository path, for example JamesIves/github-pages-deploy-action */
30-
gitHubRepository?: string;
3129
/** GitHub deployment token. */
3230
gitHubToken?: string | null;
3331
/** Determines if the action is running in test mode or not. */
3432
isTest?: string | undefined | null;
3533
/** The git config name. */
3634
name?: string;
37-
/** The fully qualified repositpory path, this gets auto generated if gitHubRepository is provided. */
35+
/** The repository path, for example JamesIves/github-pages-deploy-action */
36+
repositoryName?: string;
37+
/** The fully qualified repositpory path, this gets auto generated if repositoryName is provided. */
3838
repositoryPath?: string;
3939
/** The root directory where your project lives. */
4040
root?: string;
@@ -67,11 +67,6 @@ export const action: actionInterface = {
6767
? pusher.email
6868
: `${process.env.GITHUB_ACTOR ||
6969
"github-pages-deploy-action"}@users.noreply.github.com`,
70-
gitHubRepository: !isNullOrUndefined(getInput("REPOSITORY_PATH"))
71-
? getInput("REPOSITORY_PATH")
72-
: repository && repository.full_name
73-
? repository.full_name
74-
: process.env.GITHUB_REPOSITORY,
7570
gitHubToken: getInput("GITHUB_TOKEN"),
7671
name: !isNullOrUndefined(getInput("GIT_CONFIG_NAME"))
7772
? getInput("GIT_CONFIG_NAME")
@@ -80,7 +75,12 @@ export const action: actionInterface = {
8075
: process.env.GITHUB_ACTOR
8176
? process.env.GITHUB_ACTOR
8277
: "GitHub Pages Deploy Action",
78+
repositoryName: !isNullOrUndefined(getInput("REPOSITORY_NAME"))
79+
? getInput("REPOSITORY_NAME")
80+
: repository && repository.full_name
81+
? repository.full_name
82+
: process.env.GITHUB_REPOSITORY,
83+
root: ".",
8384
targetFolder: getInput("TARGET_FOLDER"),
84-
workspace: process.env.GITHUB_WORKSPACE || "",
85-
root: "."
85+
workspace: process.env.GITHUB_WORKSPACE || ""
8686
};

src/util.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export const generateTokenType = (action: actionInterface): string =>
1818
/* Generates a the repository path used to make the commits. */
1919
export const generateRepositoryPath = (action: actionInterface): string =>
2020
action.ssh
21-
? `git@github.com:${action.gitHubRepository}`
21+
? `git@github.com:${action.repositoryName}`
2222
: `https://${action.accessToken ||
2323
`x-access-token:${action.gitHubToken}`}@github.com/${
24-
action.gitHubRepository
24+
action.repositoryName
2525
}.git`;
2626

2727
/* Checks for the required tokens and formatting. Throws an error if any case is matched. */

0 commit comments

Comments
 (0)