-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from meeDamian/release-v2
Version 2
- Loading branch information
Showing
5 changed files
with
175 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ name: Create shortened tags | |
# Only triggered on git tag push | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
tags: [ '*' ] | ||
|
||
jobs: | ||
shorten: | ||
|
@@ -15,29 +14,29 @@ jobs: | |
|
||
- name: Make sure that current tag is merged to master | ||
run: | | ||
cd "${GITHUB_WORKSPACE}" | ||
cd "$GITHUB_WORKSPACE" | ||
git switch master | ||
# Returns 1 if it's not, and therefore terminates the workflow | ||
git merge-base --is-ancestor "${GITHUB_SHA}" HEAD | ||
git merge-base --is-ancestor "$GITHUB_SHA" HEAD | ||
- name: Create, or update the short-name branch | ||
run: | | ||
cd "${GITHUB_WORKSPACE}" | ||
cd "$GITHUB_WORKSPACE" | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
TAG=$(echo "${GITHUB_REF}" | awk -F/ '{print $NF}') | ||
SHORT=$(echo "${TAG}" | tr -d v | cut -d. -f-2) | ||
TAG=$(echo "$GITHUB_REF" | awk -F/ '{print $NF}') | ||
SHORT=$(echo "${TAG#v}" | cut -d. -f-2) | ||
# Do nothing on test tags | ||
if [[ "${SHORT}" = "0.0" ]]; then | ||
if [[ "$SHORT" = "0.0" ]]; then | ||
exit 0 | ||
fi | ||
git branch -f "${SHORT}" "${TAG}" | ||
git branch -f "$SHORT" "$TAG" | ||
REMOTE="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | ||
git push --force "${REMOTE}" "${SHORT}" | ||
REMOTE="https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" | ||
git push --force "$REMOTE" "$SHORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
FROM alpine:3.10 | ||
FROM alpine:3.11 | ||
|
||
RUN apk update \ | ||
&& apk add file curl jq | ||
RUN apk add --no-cache file curl jq | ||
|
||
COPY entrypoint.sh / | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
ENTRYPOINT [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.