Checks for relative path names (#15)

* Relative

* Update entrypoint.sh

* Update entrypoint.sh

* Another test

* Update entrypoint.sh

* Update entrypoint.sh
This commit is contained in:
James Ives 2019-08-25 18:16:24 -04:00 committed by GitHub
parent f5a4689a00
commit f7faf642c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -43,7 +43,7 @@ Below you'll find a description of what each option does.
| ------------- | ------------- | ------------- | ------------- | | ------------- | ------------- | ------------- | ------------- |
| `ACCESS_TOKEN` | In order for GitHub to trigger the rebuild of your page you must provide the action with a GitHub personal access token. 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` | **Yes** | | `ACCESS_TOKEN` | In order for GitHub to trigger the rebuild of your page you must provide the action with a GitHub personal access token. 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` | **Yes** |
| `BRANCH` | This is the branch you wish to deploy to, for example `gh-pages` or `docs`. | `env` | **Yes** | | `BRANCH` | This is the branch you wish to deploy to, for example `gh-pages` or `docs`. | `env` | **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. | `env` | **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 `./`**. | `env` | **Yes** |
| `BASE_BRANCH` | The base branch of your repository which you'd like to checkout prior to deploying. This defaults to `master`. | `env` | **No** | | `BASE_BRANCH` | The base branch of your repository which you'd like to checkout prior to deploying. This defaults to `master`. | `env` | **No** |
| `BUILD_SCRIPT` | If you require a build script to compile your code prior to pushing it you can add the script here. The Docker container which powers the action runs Node which means `npm` commands are valid. If you're using a static site generator such as Jekyll I'd suggest compiling the code prior to pushing it to your base branch. | `env` | **No** | | `BUILD_SCRIPT` | If you require a build script to compile your code prior to pushing it you can add the script here. The Docker container which powers the action runs Node which means `npm` commands are valid. If you're using a static site generator such as Jekyll I'd suggest compiling the code prior to pushing it to your base branch. | `env` | **No** |
| `CNAME` | If you're using a [custom domain](https://help.github.com/en/articles/using-a-custom-domain-with-github-pages), you will need to add the domain name to the `CNAME` environment variable. If you don't do this GitHub will wipe out your domain configuration after each deploy. This value will look something like this: `jives.dev`. | `env` | **No** | | `CNAME` | If you're using a [custom domain](https://help.github.com/en/articles/using-a-custom-domain-with-github-pages), you will need to add the domain name to the `CNAME` environment variable. If you don't do this GitHub will wipe out your domain configuration after each deploy. This value will look something like this: `jives.dev`. | `env` | **No** |

9
action.yml Normal file
View File

@ -0,0 +1,9 @@
name: 'Deploy to GitHub Pages'
description: 'This action will handle the building and deploying process of your project to GitHub Pages.'
author: 'James Ives <iam@jamesiv.es>'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'git-commit'
color: 'orange'

View File

@ -20,6 +20,11 @@ then
exit 1 exit 1
fi fi
case "$FOLDER" in /*|./*)
echo "The deployment folder cannot be prefixed with '/' or './'. Instead reference the folder name directly."
exit 1
esac
if [ -z "$COMMIT_EMAIL" ] if [ -z "$COMMIT_EMAIL" ]
then then
COMMIT_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com" COMMIT_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com"