Improved commit message for firmware build
This commit is contained in:
17
.github/workflows/validate_esphome.yml
vendored
17
.github/workflows/validate_esphome.yml
vendored
@@ -201,13 +201,24 @@ jobs:
|
|||||||
cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.bin prebuilt/nspanel_esphome_prebuilt.bin || true
|
cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.bin prebuilt/nspanel_esphome_prebuilt.bin || true
|
||||||
cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware-factory.bin prebuilt/nspanel_esphome_prebuilt-factory.bin || true
|
cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware-factory.bin prebuilt/nspanel_esphome_prebuilt-factory.bin || true
|
||||||
|
|
||||||
- name: Commit and Push Firmware File
|
- name: Set Commit Message
|
||||||
|
id: set_commit_message
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel - ${{ github.event.pull_request.title }}" >> $GITHUB_ENV
|
||||||
|
elif [[ "${{ github.event_name }}" == "push" ]]; then
|
||||||
|
commit_message=$(git log -1 --pretty=format:'%s')
|
||||||
|
echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel - $commit_message" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit and Push Firmware Files
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'GitHub Actions'
|
git config --global user.name 'GitHub Actions'
|
||||||
git config --global user.email 'actions@github.com'
|
git config --global user.email 'actions@github.com'
|
||||||
commit_message="${{ github.event.pull_request.title || 'Actions' }}"
|
|
||||||
git add prebuilt/*.bin
|
git add prebuilt/*.bin
|
||||||
git commit -m "Pre-built firmware for NSPanel - $commit_message"
|
git commit -m "${{ env.COMMIT_MESSAGE }}"
|
||||||
git push
|
git push
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user