Skip to content

Commit

Permalink
Add back PR commenting with artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz committed Sep 2, 2024
1 parent 0e5bef7 commit e889745
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,33 @@ jobs:
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}

comment:
if: github.event_name == 'pull_request'
name: Comment on PR
runs-on: ubuntu-latest
needs:
- build-firmware
steps:
- name: Comment on PR
uses: actions/[email protected]
with:
script: |-
const artifacts = github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
})
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Firmware built successfully! :tada:
[Download][download] and extract the firmware to install with https://web.esphome.io
Make sure to choose \`esphome-voice-kit-esp32s3/esphome-voice-kit-esp32s3.factory.bin\`.
[download]: {artifacts['artifacts'][0]['archive_download_url']}`
})
upload:
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/dev')
name: Upload to R2
Expand Down

0 comments on commit e889745

Please sign in to comment.