File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
generate-docker-image-tags Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ runs:
38
38
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]
39
39
then
40
40
BRANCH=$GITHUB_HEAD_REF
41
- elif [ "$GITHUB_EVENT_NAME" == "push" ]
41
+ elif [ "$GITHUB_EVENT_NAME" == "push" ] || [ "$GITHUB_EVENT_NAME" == "release" ]
42
42
then
43
43
BRANCH=${GITHUB_REF##*/}
44
44
else
45
- printf 'Cannot determine tags: Workflow must be triggered by "push" or "pull_request " event.' && exit 1
45
+ printf 'Cannot determine tags: Workflow must be triggered by "push", "pull_request", or "release " event.' && exit 1
46
46
fi
47
47
48
48
printf "::set-output name=branch::$BRANCH"
@@ -62,14 +62,17 @@ runs:
62
62
63
63
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]
64
64
then
65
- PR_NUMBER=${{ github.event.number }}
66
- else
65
+ PR_NUMBER="${{ github.event.number }}"
66
+ elif [ "$GITHUB_EVENT_NAME" == "push" ]
67
+ then
67
68
# Workflow was triggered by a "push" event.
68
- PR_NUMBER=$(
69
- echo "${{ github.event.head_commit.message }}" \
70
- | grep -o "(#[0-9]*)" \
71
- | sed ' s/[#()]//g'
69
+ PR_NUMBER=$( \
70
+ ( echo "${{ github.event.head_commit.message }}" \
71
+ | grep -o "\ (#[0-9]\+\)" || true) \
72
+ | sed " s/[#()]//g" \
72
73
)
74
+ else
75
+ PR_NUMBER=""
73
76
fi
74
77
75
78
# Add additional tags for each Story ID associated with this PR.
You can’t perform that action at this time.
0 commit comments