Skip to content

Commit

Permalink
Add support for additional flags
Browse files Browse the repository at this point in the history
Supported flags:
* -e - respect existing tags
* -s - strict matching
  • Loading branch information
lukaszraczylo committed Mar 30, 2023
1 parent 601f486 commit 817fb91
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 22 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Project created overnight, to prove that management of semantic versioning is NO
- [As a binary](#as-a-binary)
- [As a github action](#as-a-github-action)
- [As a docker container](#as-a-docker-container)
- [Calculations example [standard]](#calculations-example-standard)
- [Calculations example [strict matching]](#calculations-example-strict-matching)
- [Calculations example \[standard\]](#calculations-example-standard)
- [Calculations example \[strict matching\]](#calculations-example-strict-matching)
- [Release candidates](#release-candidates)
- [Example configuration](#example-configuration)
- [Good to know](#good-to-know)
Expand Down Expand Up @@ -111,6 +111,8 @@ jobs:
# when using remote repository, especially with private one:
github_username: lukaszraczylo
github_token: MySupeRSecr3tPa$$w0rd
strict: true
existing: false
- name: Semver check
run: |
echo "Semantic version detected: ${{ steps.semver.outputs.semantic_version }}"
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ inputs:
github_username:
description: 'GitHub or other git hosting provider username'
required: false
strict:
description: 'Strict mode'
required: false
existing:
description: 'Respect existing tags'
required: false
outputs:
semantic_version:
description: 'Calculated semantic version'
Expand Down
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ if [[ ! -z "$INPUT_REPOSITORY_LOCAL" ]]; then
FLAGS="${FLAGS} -l"
fi

if [[ ! -z "$INPUT_STRICT" ]]; then
FLAGS="${FLAGS} -s"
fi

if [[ ! -z "$INPUT_EXISTING" ]]; then
FLAGS="${FLAGS} -e"
fi

if [[ "${FLAGS}" == "" && "$*" == "" ]]; then
exit 1
fi
Expand Down
40 changes: 20 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,50 @@ module github.com/lukaszraczylo/semver-generator
go 1.19

require (
github.com/go-git/go-git/v5 v5.5.2
github.com/go-git/go-git/v5 v5.6.1
github.com/lithammer/fuzzysearch v1.1.5
github.com/lukaszraczylo/go-simple-graphql v1.0.69
github.com/lukaszraczylo/pandati v0.0.17
github.com/lukaszraczylo/go-simple-graphql v1.0.74
github.com/lukaszraczylo/pandati v0.0.18
github.com/melbahja/got v0.7.0
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.14.0
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.1
github.com/tidwall/gjson v1.14.4
)

require (
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230113180642-068501e20d67 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230321155629-9a39f2531310 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/allegro/bigcache/v3 v3.1.0 // indirect
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/cloudflare/circl v1.3.1 // indirect
github.com/cloudflare/circl v1.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.0 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pjbgf/sha1cd v0.2.3 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/zerolog v1.28.0 // indirect
github.com/rs/zerolog v1.29.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/sethvargo/go-retry v0.2.4 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -55,12 +55,12 @@ require (
github.com/tidwall/pretty v1.2.1 // indirect
github.com/wI2L/jsondiff v0.3.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.5.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.7.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 817fb91

Please sign in to comment.