Skip to content

Commit

Permalink
chore: change to require-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
guitarrapc committed Aug 20, 2024
1 parent 073e8cf commit 464e1f6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 7,11 @@ on:
description: "commit-id: CommitId to create release & tag."
required: false
type: string
require-validation:
description: "require-validation: true require validation must pass, false to keep going even validation failed."
required: false
type: boolean
default: true
tag:
description: "tag: Git tag to create. (sample 1.0.0)"
required: true
Expand Down Expand Up @@ -41,6 46,11 @@ on:
description: "CommitId to create release & tag."
required: true
type: string
require-validation:
description: "true require validation must pass, false to keep going even validation failed."
required: false
type: boolean
default: true
tag:
description: "Git tag to create. (sample 1.0.0)"
required: true
Expand Down Expand Up @@ -102,7 112,7 @@ jobs:
uses: Cysharp/Actions/.github/workflows/validate-tag.yaml@main
with:
tag: ${{ inputs.tag }}
fail-on-invalid: true
require-validation: ${{ inputs.require-validation }}
secrets: inherit

create-release:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-validate-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 18,15 @@ jobs:
uses: ./.github/workflows/validate-tag.yaml
with:
tag: "1.10.0"
fail-on-invalid: true
require-validation: true
secrets: inherit

validate2:
if: ${{ github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/validate-tag.yaml
with:
tag: "1.0.0"
fail-on-invalid: false
require-validation: false
secrets: inherit

test:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/update-packagejson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 7,11 @@ on:
description: "package.json path to update. You can input multiline paths. Supported files are `package.json`, `plugin.cfg` and `Directory.Build.props`"
required: true
type: string
require-validation:
description: "true require validation must pass, false to keep going even validation failed."
required: false
type: boolean
default: true
tag:
description: "git tag you want create. (sample 1.0.0)"
required: true
Expand Down Expand Up @@ -46,7 51,7 @@ jobs:
uses: Cysharp/Actions/.github/workflows/validate-tag.yaml@main
with:
tag: ${{ inputs.tag }}
fail-on-invalid: true
require-validation: ${{ inputs.require-validation }}
secrets: inherit

update-packagejson:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/validate-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 3,8 @@ name: (R) Validate Tag
on:
workflow_call:
inputs:
fail-on-invalid:
description: "fail-on-invalid: allow old tag or not"
require-validation:
description: "require-validation: true disallow old tag or any invalid tag. false keep going even validate failed."
required: false
default: false
type: boolean
Expand All @@ -21,8 21,8 @@ on:
value: ${{ jobs.validate.outputs.validated }}
workflow_dispatch:
inputs:
fail-on-invalid:
description: "fail-on-invalid: allow old tag or not"
require-validation:
description: "require-validation: allow old tag or not"
required: false
default: false
type: boolean
Expand Down Expand Up @@ -59,7 59,7 @@ jobs:
echo "Tag is reverting to old version. Please bump the version. tag: ${{ inputs.tag }}, latest: $release_latest"
echo "validated=false" | tee -a "$GITHUB_OUTPUT"
if [[ "${{ inputs.fail-on-invalid }}" == "true" ]]; then
if [[ "${{ inputs.require-validation }}" == "true" ]]; then
exit 1
fi
else
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 418,18 @@ on:
tag:
description: "tag: git tag you want create. (sample 1.0.0)"
required: true
require-validation:
description: "require-validation: true require validation must pass, false to keep going even validation failed."
required: false
type: boolean
default: true
jobs:
validate:
uses: Cysharp/Actions/.github/workflows/validate-tag.yaml@main
with:
tag: ${{ inputs.tag }}
fail-on-invalid: true # exit 1 if tag is older than current release
require-validation: ${{ inputs.require-validation }} # true = exit 1 if tag is older than current release. false = keep going even failed.
test:
needs: [validate]
Expand Down

0 comments on commit 464e1f6

Please sign in to comment.