Skip to content

Commit

Permalink
chore(gh-action): enable artifact comment
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Feb 12, 2024
1 parent eb6f1cd commit a61c790
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/publish_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,34 @@ name: Publish artifacts

on:
pull_request:
types: [ labeled ]
types:
- labeled
- synchronize

jobs:
build-artifacts:
if: ${{ github.event.label.name == 'artifact' }}
runs-on: ubuntu-latest

steps:
- name: Find a PR comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: 'Artifacts deployed: '
- name: Delete Comment
uses: actions/github-script@v6
continue-on-error: true
if: steps.fc.outputs.comment-id != 0
with:
script: |
github.rest.issues.deleteComment({
comment_id: ${{ steps.fc.outputs.comment-id }},
owner: context.repo.owner,
repo: context.repo.repo,
})
- uses: actions/checkout@v3

- name: Install node
Expand All @@ -26,3 +46,10 @@ jobs:
with:
name: build-artifacts
path: build/

- name: Update the PR comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Artifacts deployed: ${{ steps.artifact-upload-step.outputs.artifact-url }}

0 comments on commit a61c790

Please sign in to comment.