mirror of
https://github.com/elgohr/Publish-Docker-Github-Action.git
synced 2026-03-12 18:07:12 -04:00
✨ Introduce default_branch
This commit is contained in:
15
test.bats
15
test.bats
@@ -614,6 +614,21 @@ teardown() {
|
||||
/usr/local/bin/docker logout"
|
||||
}
|
||||
|
||||
@test "it can change the default branch" {
|
||||
export GITHUB_REF='refs/heads/trunk'
|
||||
export INPUT_DEFAULT_BRANCH='trunk'
|
||||
|
||||
run /entrypoint.sh
|
||||
|
||||
expectStdOutContains "::set-output name=tag::latest"
|
||||
|
||||
expectMockCalledContains "/usr/local/bin/docker login -u USERNAME --password-stdin
|
||||
/usr/local/bin/docker build -t my/repository:latest .
|
||||
/usr/local/bin/docker push my/repository:latest
|
||||
/usr/local/bin/docker inspect --format={{index .RepoDigests 0}} my/repository:latest
|
||||
/usr/local/bin/docker logout"
|
||||
}
|
||||
|
||||
expectStdOutIs() {
|
||||
local expected=$(echo "${1}" | tr -d '\n')
|
||||
local got=$(echo "${output}" | tr -d '\n')
|
||||
|
||||
Reference in New Issue
Block a user