Fix GitHub Actions nightly workflow

This commit is contained in:
cytopia
2020-11-29 09:40:31 +01:00
parent 3cdede3519
commit 9bddaad387
3 changed files with 22 additions and 18 deletions

View File

@@ -18,7 +18,7 @@ jobs:
job: [gen-dockerfiles]
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Diff generated Docker files
run: |
make "${JOB}"

View File

@@ -32,7 +32,7 @@ jobs:
fail-fast: False
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Show environment
run: |
@@ -91,18 +91,19 @@ jobs:
- name: Set variables
id: vars
run: |
# Set git branch or git tag as slug
if [[ ${GITHUB_REF} =~ ^refs\/tags\/ ]]; then
# Detached from branch
if [ "$( git rev-parse --abbrev-ref HEAD )" = "HEAD" ]; then
GIT_TYPE=TAG
GIT_SLUG="${GITHUB_REF/refs\/tags\//}"
GIT_SLUG="$( git tag --points-at HEAD | head -1 )"
else
GIT_TYPE=BRANCH
if [ -n "${GITHUB_HEAD_REF}" ]; then
GIT_SLUG="${GITHUB_HEAD_REF}"
else
GIT_SLUG="${GITHUB_REF/refs\/heads\//}"
fi
GIT_SLUG="$( git rev-parse --abbrev-ref HEAD )"
fi
# Output
echo "GIT_TYPE=${GIT_TYPE}"
echo "GIT_SLUG=${GIT_SLUG}"
# Export variable
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
echo "GIT_TYPE=${GIT_TYPE}" >> $GITHUB_ENV

View File

@@ -26,7 +26,7 @@ jobs:
fail-fast: False
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Show environment
run: |
@@ -82,7 +82,7 @@ jobs:
- '8.1'
refs:
- 'master'
- '0.114'
- '0.118'
steps:
# ------------------------------------------------------------
@@ -97,16 +97,19 @@ jobs:
- name: Set variables
id: vars
run: |
# Set git branch or git tag as slug
if [ -n "$( git tag --points-at HEAD )" ]; then
# Detached from branch
if [ "$( git rev-parse --abbrev-ref HEAD )" = "HEAD" ]; then
GIT_TYPE=TAG
GIT_SLUG="$( git tag --points-at HEAD )"
elif [ "$( git rev-parse --abbrev-ref HEAD )" != "HEAD" ]; then
GIT_SLUG="$( git tag --points-at HEAD | head -1 )"
else
GIT_TYPE=BRANCH
GIT_SLUG="$( git rev-parse --abbrev-ref HEAD )"
else
false
fi
# Output
echo "GIT_TYPE=${GIT_TYPE}"
echo "GIT_SLUG=${GIT_SLUG}"
# Export variable
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files
echo "GIT_TYPE=${GIT_TYPE}" >> $GITHUB_ENV