mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Removes the need for COMMIT_NAME and COMMIT_EMAIL (#25)
* Actor Changes * Default Action Name/Email * Update entrypoint.sh * Update entrypoint.sh
This commit is contained in:
parent
ffe5eb539e
commit
60732f6ba6
@ -54,8 +54,6 @@ Below you'll find a description of what each option does.
|
|||||||
| `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** |
|
||||||
| `COMMIT_EMAIL` | Used to sign the commit, this should be your email. If not provided it will default to `username@users.noreply.github.com`. | `env` | **No** |
|
|
||||||
| `COMMIT_NAME` | Used to sign the commit, this should be your name. If not provided it will default to your username. | `env` | **No** |
|
|
||||||
|
|
||||||
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.
|
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.
|
||||||
|
|
||||||
|
@ -25,20 +25,26 @@ case "$FOLDER" in /*|./*)
|
|||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Installs Git and jq.
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y git && \
|
||||||
|
apt-get install -y jq && \
|
||||||
|
|
||||||
|
# Gets the commit email/name if it exists in the push event payload.
|
||||||
|
COMMIT_EMAIL=`jq '.pusher.email' ${GITHUB_EVENT_PATH}`
|
||||||
|
COMMIT_NAME=`jq '.pusher.name' ${GITHUB_EVENT_PATH}`
|
||||||
|
|
||||||
|
# If the commit email/name is not found in the event payload then it falls back to the actor.
|
||||||
if [ -z "$COMMIT_EMAIL" ]
|
if [ -z "$COMMIT_EMAIL" ]
|
||||||
then
|
then
|
||||||
COMMIT_EMAIL="${GITHUB_ACTOR}@users.noreply.github.com"
|
COMMIT_EMAIL="${GITHUB_ACTOR:-github-pages-deploy-action}@users.noreply.github.com"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$COMMIT_NAME" ]
|
if [ -z "$COMMIT_NAME" ]
|
||||||
then
|
then
|
||||||
COMMIT_NAME="${GITHUB_ACTOR}"
|
COMMIT_NAME="${GITHUB_ACTOR:-GitHub Pages Deploy Action}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Installs Git.
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y git && \
|
|
||||||
|
|
||||||
# Directs the action to the the Github workspace.
|
# Directs the action to the the Github workspace.
|
||||||
cd $GITHUB_WORKSPACE && \
|
cd $GITHUB_WORKSPACE && \
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user