Skip to content

Commit

Permalink
Merge branch 'Mosibi:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rysiulg authored Oct 30, 2024
2 parents b721698 + 8d9eb83 commit a5da76e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Binary file removed .github/scripts/.set_version.sh.swp
Binary file not shown.
1 change: 1 addition & 0 deletions .github/scripts/set_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ if [[ ! -z "${VERSION_FROM_CHANGELOG}" ]] && [[ "${VERSION_FROM_CHANGELOG}" =~ ^
else
sed -i -E "s/(^\ {4}version:)(.*$)/\1 ${VERSION_FROM_CHANGELOG}/g" heatpump.yaml || Error "Could not update version in heatpump.yaml"
Info "Version in heatpump.yaml is successful updated to ${VERSION_FROM_CHANGELOG}"
echo "YAML_UPDATED=true" >> $GITHUB_ENV
fi
else
Warning "Version extracted from CHANGELOG.md does not seem to be a version tag: ${VERSION_FROM_CHANGELOG}, version will not be updated"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- master
types: [closed]

env:
YAML_UPDATED: false

jobs:
update-version:
if: ${{ github.event.pull_request.merged }}
Expand All @@ -22,11 +25,13 @@ jobs:
bash .github/scripts/set_version.sh
cat heatpump.yaml |grep -A7 ^esphome
- name: Commit files
if: ${{ env.YAML_UPDATED == 'true' }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "Updated version in heatpump.yaml"
- name: Push changes
if: ${{ env.YAML_UPDATED == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit a5da76e

Please sign in to comment.