From 1e49cabeb185aaa450c5b1b918ba66cbef8615e0 Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 19 Nov 2019 10:22:12 -0500 Subject: [PATCH 1/7] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9e507ed3..b78b4fb6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* - node_modules \ No newline at end of file From ac30688c26e9c5b6a5f36d7df209667998c002f7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2019 10:43:35 -0500 Subject: [PATCH 2/7] Bump @types/jest from 24.0.18 to 24.0.23 (#53) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 24.0.18 to 24.0.23. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index a440b1ad..76723c87 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@actions/io": "^1.0.1" }, "devDependencies": { - "@types/jest": "^24.0.13", + "@types/jest": "^24.0.23", "@types/node": "^12.11.0", "jest": "^24.8.0", "jest-circus": "^24.7.1", diff --git a/yarn.lock b/yarn.lock index c70247a9..755937bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -385,15 +385,11 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/jest-diff@*": - version "20.0.1" - resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" - -"@types/jest@^24.0.13": - version "24.0.18" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.18.tgz#9c7858d450c59e2164a8a9df0905fc5091944498" +"@types/jest@^24.0.23": + version "24.0.23" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.23.tgz#046f8e2ade026fe831623e361a36b6fb9a4463e4" dependencies: - "@types/jest-diff" "*" + jest-diff "^24.3.0" "@types/node@>= 8", "@types/node@^12.11.0": version "12.12.6" @@ -1626,7 +1622,7 @@ jest-config@^24.9.0: pretty-format "^24.9.0" realpath-native "^1.1.0" -jest-diff@^24.9.0: +jest-diff@^24.3.0, jest-diff@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" dependencies: From 96362cea47c3a9697a16523713a8411bb9c3f719 Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 19 Nov 2019 10:46:01 -0500 Subject: [PATCH 3/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57e79594..445b2aaa 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Below you'll find a description of what each option does. | `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` | **No** | | `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 }}`. Only required if an access token is **not** provided. **Please note there is currently an issue affecting the use of this token, [you can learn more here](https://github.com/JamesIves/github-pages-deploy-action/issues/5)**. | `secrets` | **Yes** | | `BRANCH` | This is the branch you wish to deploy to, for example `gh-pages` or `docs`. | `with` | **Yes** | -| `FOLDER` | The folder in your repository that you want to deploy. If your build script compiles into a directory named `build` you'd put it here. **Folder paths cannot have a leading `/` or `./`**. | `with` | **Yes** | +| `FOLDER` | The folder in your repository that you want to deploy. If your build script compiles into a directory named `build` you'd put it here. **Folder paths cannot have a leading `/` or `./`**. If you wish to deploy the root directory you can place a `.` here. | `with` | **Yes** | | `BASE_BRANCH` | The base branch of your repository which you'd like to checkout prior to deploying. This defaults to `master`. | `with` | **No** | With the action correctly configured you should see the workflow trigger the deployment under the configured conditions. From 6dcc761bdf81dcc06962ab0df8a3e3ebb81b71e8 Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 19 Nov 2019 10:46:43 -0500 Subject: [PATCH 4/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 445b2aaa..5e67ab70 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ Below you'll find a description of what each option does. | Key | Value Information | Type | Required | | ------------- | ------------- | ------------- | ------------- | -| `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` | **No** | -| `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 }}`. Only required if an access token is **not** provided. **Please note there is currently an issue affecting the use of this token, [you can learn more here](https://github.com/JamesIves/github-pages-deploy-action/issues/5)**. | `secrets` | **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` | **No** | +| `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 }}`. Only required if an access token is **not** provided. **Please note there is currently an issue affecting the use of this token, [you can learn more here](https://github.com/JamesIves/github-pages-deploy-action/issues/5)**. | `secrets / with` | **Yes** | | `BRANCH` | This is the branch you wish to deploy to, for example `gh-pages` or `docs`. | `with` | **Yes** | | `FOLDER` | The folder in your repository that you want to deploy. If your build script compiles into a directory named `build` you'd put it here. **Folder paths cannot have a leading `/` or `./`**. If you wish to deploy the root directory you can place a `.` here. | `with` | **Yes** | | `BASE_BRANCH` | The base branch of your repository which you'd like to checkout prior to deploying. This defaults to `master`. | `with` | **No** | From 38b00db2aaa7195c12ba9ecf04bd0e4b90009a2b Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 19 Nov 2019 10:47:53 -0500 Subject: [PATCH 5/7] Code of Conduct --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..ad25d444 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at iam@jamesiv.es. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 7a65168f1100cae3b1a6cc5149e82aa211ce3d5d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2019 11:26:17 -0500 Subject: [PATCH 6/7] Bump @types/node from 12.12.6 to 12.12.9 (#51) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.6 to 12.12.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 76723c87..b862a333 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@types/jest": "^24.0.23", - "@types/node": "^12.11.0", + "@types/node": "^12.12.9", "jest": "^24.8.0", "jest-circus": "^24.7.1", "lodash": "^4.17.15", diff --git a/yarn.lock b/yarn.lock index 755937bc..ac70f604 100644 --- a/yarn.lock +++ b/yarn.lock @@ -391,9 +391,9 @@ dependencies: jest-diff "^24.3.0" -"@types/node@>= 8", "@types/node@^12.11.0": - version "12.12.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.6.tgz#a47240c10d86a9a57bb0c633f0b2e0aea9ce9253" +"@types/node@>= 8", "@types/node@^12.12.9": + version "12.12.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.9.tgz#0b5ae05516b757cbff2e82c04500190aef986c7b" "@types/stack-utils@^1.0.1": version "1.0.1" From 0dfa1cb46b89829e68c089bd6de74add7392bf8f Mon Sep 17 00:00:00 2001 From: James Ives Date: Tue, 19 Nov 2019 18:07:27 -0500 Subject: [PATCH 7/7] Skips deployment if the working tree is clean (#55) * Adding procelain * Update git.ts --- lib/git.js | 5 +++++ src/git.ts | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/git.js b/lib/git.js index f3d5f56b..162f333f 100644 --- a/lib/git.js +++ b/lib/git.js @@ -102,6 +102,11 @@ function deploy() { force: true }); } + const hasFilesToCommit = yield util_1.execute(`git status --porcelain`, temporaryDeploymentDirectory); + if (!hasFilesToCommit) { + console.log('There is nothing to commit. Exiting...'); + return Promise.resolve(); + } // Commits to GitHub. yield util_1.execute(`git add --all .`, temporaryDeploymentDirectory); yield util_1.execute(`git switch -c ${temporaryDeploymentBranch}`, temporaryDeploymentDirectory); diff --git a/src/git.ts b/src/git.ts index f7001575..66e1f79d 100644 --- a/src/git.ts +++ b/src/git.ts @@ -99,6 +99,16 @@ export async function deploy(): Promise { }); } + const hasFilesToCommit = await execute( + `git status --porcelain`, + temporaryDeploymentDirectory + ); + + if (!hasFilesToCommit) { + console.log("There is nothing to commit. Exiting..."); + return Promise.resolve(); + } + // Commits to GitHub. await execute(`git add --all .`, temporaryDeploymentDirectory); await execute(