Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ _A collection of GitHub Action helpers, these are considered internal to the Hom
- [git-init](./helpers/git-init/action.yml)
- [info](./helpers/info/action.yml)
- [jq](./helpers/jq/action.yml)
- [verify-version](./helpers/action.yml)
- [version](./helpers/version/action.yml)
- [version-push](./helpers/version-push/action.yml)
27 changes: 27 additions & 0 deletions helpers/verify-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Home Assistant helper: verify-version'
description: 'GitHub action helper: verify-version'
inputs:
ignore-dev:
description: Skip check if the branch is 'dev'
required: false
default: false
ignore-master:
description: Skip check if the branch is 'master'
required: false
default: false
runs:
using: "composite"
steps:
- shell: bash
run: |
setup_version="$(python3 setup.py -V)"
branch_version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}' )

if [[ "${{ inputs.ignore-dev }}" =~ true|True ]] && [ "${branch_version}" == "dev" ]; then
exit 0
elif [[ "${{ inputs.ignore-master }}" =~ true|True ]] && [ "${branch_version}" == "master" ]; then
exit 0
elif [ "${setup_version}" != "${branch_version}" ]; then
echo "Version of tag ${branch_version} don't match with ${setup_version}!"
exit 1
fi