diff --git a/README.md b/README.md index 692b3dfb..607977da 100644 --- a/README.md +++ b/README.md @@ -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** | | `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** | | `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** | diff --git a/action.yml b/action.yml new file mode 100644 index 00000000..2de0c4b2 --- /dev/null +++ b/action.yml @@ -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 ' +runs: + using: 'docker' + image: 'Dockerfile' +branding: + icon: 'git-commit' + color: 'orange' \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 8b1c8df5..5a4f5286 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,6 +20,11 @@ then exit 1 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" ] then COMMIT_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com"