Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
add docker tag script
Browse files Browse the repository at this point in the history
  • Loading branch information
athornton committed May 20, 2022
1 parent 97cd31c commit 445f4bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/docker-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Determine the tag for Docker images based on GitHub Actions environment
# variables.

set -eo pipefail

if [ -n "$GITHUB_HEAD_REF" ]; then
# For pull requests
echo ${GITHUB_HEAD_REF} | sed -E 's,/,-,g'
else
# For push events
echo ${GITHUB_REF} | sed -E 's,refs/(heads|tags)/,,' | sed -E 's,/,-,g'
fi

0 comments on commit 445f4bd

Please sign in to comment.