Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull through artifactory #331

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .8451/metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
program: Science & Developer Services
profit_stream: enterprise_capabilities
value_stream: DevSecOps
product: SDS
capability: Build
component: ext-fork-github-tag-action
team: Dev Pipelines
contacts:
team:
- [email protected]
technical:
- [email protected]
product:
- [email protected]
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@master
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.10
FROM docker-all.artifactory.8451.cloud/alpine:3.10
LABEL "repository"="https://github.com/anothrNick/github-tag-action"
LABEL "homepage"="https://github.com/anothrNick/github-tag-action"
LABEL "maintainer"="Nick Sjostrom"
Expand Down
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@

A Github Action to automatically bump and tag master, on merge, with the latest SemVer formatted version.

[![Build Status](https://github.com/anothrNick/github-tag-action/workflows/Bump%20version/badge.svg)](https://github.com/anothrNick/github-tag-action/workflows/Bump%20version/badge.svg)
[![Stable Version](https://img.shields.io/github/v/tag/anothrNick/github-tag-action)](https://img.shields.io/github/v/tag/anothrNick/github-tag-action)
[![Latest Release](https://img.shields.io/github/v/release/anothrNick/github-tag-action?color=%233D9970)](https://img.shields.io/github/v/release/anothrNick/github-tag-action?color=%233D9970)
> **IMPORTANT:** This is a fork of [anothrNick/github-tag-action](https://github.com/anothrNick/github-tag-action), and is branched fo development from tag [1.36.0](https://github.com/anothrNick/github-tag-action/releases/tag/1.36.0) (commit hash [ce4b5ffa38e072fa7a901e417253c438fcc2ccce](https://github.com/anothrNick/github-tag-action/tree/ce4b5ffa38e072fa7a901e417253c438fcc2ccce)).

> Medium Post: [Creating A Github Action to Tag Commits](https://itnext.io/creating-a-github-action-to-tag-commits-2722f1560dec)

[<img src="https://miro.medium.com/max/1200/1*_4Ex1uUhL93a3bHyC-TgPg.png" width="400">](https://itnext.io/creating-a-github-action-to-tag-commits-2722f1560dec)

### Usage

Expand All @@ -20,13 +15,13 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.36.0
uses: ext-fork-github-tag-action@sds-1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
Expand All @@ -53,6 +48,7 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` to be sure you retrieve all
#### Outputs

- **new_tag** - The value of the newly created tag.

- **tag** - The value of the latest tag after running this action.
- **part** - The part of version which was bumped.

Expand Down Expand Up @@ -82,13 +78,3 @@ If `#none` is contained in the commit message, it will skip bumping regardless `
### Credits

[fsaintjacques/semver-tool](https://github.com/fsaintjacques/semver-tool)

### Projects using github-tag-action

A list of projects using github-tag-action for reference.

- another/github-tag-action (uses itself to create tags)

- [anothrNick/json-tree-service](https://github.com/anothrNick/json-tree-service)

> Access JSON structure with HTTP path parameters as keys/indices to the JSON.
40 changes: 29 additions & 11 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ echo -e "\tTAG_CONTEXT: ${tag_context}"
echo -e "\tPRERELEASE_SUFFIX: ${suffix}"
echo -e "\tVERBOSE: ${verbose}"

current_branch=$(git rev-parse --abbrev-ref HEAD)
current_branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}

pre_release="true"
IFS=',' read -ra branch <<< "$release_branches"
Expand Down Expand Up @@ -77,9 +77,13 @@ tag_commit=$(git rev-list -n 1 $tag)
commit=$(git rev-parse HEAD)

if [ "$tag_commit" == "$commit" ]; then
echo "No new commits since previous tag. Skipping..."
echo ::set-output name=tag::$tag
exit 0
#
# Inform the user that the commit hash is the same as the tag,
# but do not exit.
#
# This allows users to apply multiple tags to the same commit.
#
echo "No new commits since previous tag."
fi

# echo log if verbose is wanted
Expand All @@ -93,12 +97,20 @@ case "$log" in
*#minor* ) new=$(semver -i minor $tag); part="minor";;
*#patch* ) new=$(semver -i patch $tag); part="patch";;
*#none* )
echo "Default bump was set to none. Skipping..."; echo ::set-output name=new_tag::$tag; echo ::set-output name=tag::$tag; exit 0;;
echo "Default bump was set to none. Skipping..."
echo "new_tag=$tag" >> $GITHUB_OUTPUT
echo "tag=$tag" >> $GITHUB_OUTPUT
exit 0
;;
* )
if [ "$default_semvar_bump" == "none" ]; then
echo "Default bump was set to none. Skipping..."; echo ::set-output name=new_tag::$tag; echo ::set-output name=tag::$tag; exit 0
echo "Default bump was set to none. Skipping..."
echo "new_tag=$tag" >> $GITHUB_OUTPUT
echo "tag=$tag" >> $GITHUB_OUTPUT
exit 0
else
new=$(semver -i "${default_semvar_bump}" $tag); part=$default_semvar_bump
new=$(semver -i "${default_semvar_bump}" $tag)
part=$default_semvar_bump
fi
;;
esac
Expand Down Expand Up @@ -138,17 +150,23 @@ else
fi

# set outputs
echo ::set-output name=new_tag::$new
echo ::set-output name=part::$part
echo "new_tag=$new" >> $GITHUB_OUTPUT
echo "part=$part" >> $GITHUB_OUTPUT

if $pre_release
then
echo "tag=$pre_tag" >> $GITHUB_OUTPUT
else
echo "tag=$tag" >> $GITHUB_OUTPUT
fi


# use dry run to determine the next tag
if $dryrun
then
echo ::set-output name=tag::$tag
exit 0
fi

echo ::set-output name=tag::$new

# create local git tag
git tag $new
Expand Down