Skip to content

Commit c53ea46

Browse files
committed
Process Jenkins' GIT_BRANCH environment variable correctly.
1 parent 5cf9b7f commit c53ea46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jobs/hook_container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Alternatively, we can obtain the branch in detached-head state using the
3131
# environment variable GIT_BRANCH if it is set. This helps out Jenkins.
3232
- name: Obtain current branch of this repository.
33-
shell: if [ -z "$GIT_BRANCH" ]; then git symbolic-ref HEAD | grep -o [^/]*$; else echo "$GIT_BRANCH"; fi
33+
shell: if [ -z "$GIT_BRANCH" ]; then git symbolic-ref HEAD | grep -o [^/]*$; else echo "$GIT_BRANCH" | grep -o [^/][a-zA-Z0-9-]*$; fi
3434
args:
3535
chdir: "{{ container_dir }}"
3636
executable: /bin/bash

0 commit comments

Comments
 (0)