File tree Expand file tree Collapse file tree 2 files changed +22
-39
lines changed
Expand file tree Collapse file tree 2 files changed +22
-39
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,32 @@ jobs:
1313 id-token : write
1414 runs-on : ubuntu-latest
1515 steps :
16- - name : Get variables
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Get version from tag
1720 id : version
18- run : echo "::set-output name= version:: ${GITHUB_REF#refs/tags/}"
21+ run : echo "version= ${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
1922
20- - uses : actions/checkout@v4
21- with :
22- ref : ${{ steps.version.outputs.version }}
23+ - name : Read version from YAML file
24+ id : read_version
25+ run : |
26+ yaml_version=$(grep 'project_version:' esphome/components/basis.yaml | awk '{print $2}' | tr -d '"')
27+ echo "yaml_version=$yaml_version" >> $GITHUB_ENV
28+
29+ - name : Validate version consistency
30+ id : validate_version
31+ run : |
32+ if [ "${yaml_version}" != "${version}" ]; then
33+ echo "Tag version (${version}) does not match project_version (${yaml_version}) in YAML file."
34+ exit 1
35+ fi
2336
2437 - uses : release-drafter/release-drafter@v6.0.0
2538 with :
26- tag : ${{ steps.version.outputs .version }}
27- name : ${{ steps.version.outputs .version }}
28- version : ${{ steps.version.outputs .version }}
39+ tag : ${{ env .version }}
40+ name : ${{ env .version }}
41+ version : ${{ env .version }}
2942 publish : true
3043 env :
31- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments