Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub action 1729964091 #61

Merged
merged 2 commits into from
Oct 26, 2024
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
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