mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
Remove pull-request error, as it does not build to latest and the risk to go to production is low
This commit is contained in:
13
README.md
13
README.md
@@ -98,16 +98,3 @@ with:
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
cache: true
|
||||
```
|
||||
|
||||
### pull_requests
|
||||
Use `pull_requests` if you would like to publish pull requests.
|
||||
The images will be published under `pr{NUMBER_OF_PR}{ACTION_IN_REF}`
|
||||
> CAUTION: Only activate this option, when you are really sure, that nobody will be able to do something bad in your name within the PR.
|
||||
|
||||
```yaml
|
||||
with:
|
||||
name: myDocker/repository
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
pull_requests: true
|
||||
```
|
||||
|
||||
@@ -17,7 +17,6 @@ if [ -z "${INPUT_PASSWORD}" ]; then
|
||||
fi
|
||||
|
||||
BRANCH=$(echo ${GITHUB_REF} | sed -e "s/refs\/heads\///g" | sed -e "s/\//-/g")
|
||||
|
||||
if [ "${BRANCH}" = "master" ]; then
|
||||
BRANCH="latest"
|
||||
fi;
|
||||
@@ -29,10 +28,6 @@ fi;
|
||||
|
||||
# if it's a pull request
|
||||
if [ $(echo ${GITHUB_REF} | sed -e "s/refs\/pull\///g") != ${GITHUB_REF} ]; then
|
||||
if [ -z "${INPUT_PULL_REQUESTS}" ]; then
|
||||
echo "The build was triggered within a pull request, but was not configured to build pull requests. Please see with.pull_requests"
|
||||
exit 1
|
||||
fi
|
||||
BRANCH="${GITHUB_SHA}"
|
||||
fi;
|
||||
|
||||
|
||||
12
test.bats
12
test.bats
@@ -231,18 +231,6 @@ Called /usr/local/bin/docker logout"
|
||||
[ "$output" = "$expected" ]
|
||||
}
|
||||
|
||||
@test "it errors on pull requests when not configured" {
|
||||
export GITHUB_REF='refs/pull/24/merge'
|
||||
unset INPUT_PULL_REQUESTS
|
||||
|
||||
run /entrypoint.sh
|
||||
|
||||
local expected="The build was triggered within a pull request, but was not configured to build pull requests. Please see with.pull_requests"
|
||||
echo $output
|
||||
[ "$status" -eq 1 ]
|
||||
[ "$output" = "$expected" ]
|
||||
}
|
||||
|
||||
@test "it errors when with.name was not set" {
|
||||
unset INPUT_NAME
|
||||
|
||||
|
||||
Reference in New Issue
Block a user