File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,18 @@ jobs:
41
41
- if : github.event_name == 'pull_request'
42
42
env :
43
43
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44
+ PR_NUMBER : ${{ github.event.number }}
45
+ WORKFLOW : ${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts
44
46
run : |
45
- id=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts --jq '.artifacts[0].id')
46
- url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$id
47
- comment ="Try the changes in this PR by [side-loading the built extension]($url). :rocket:"
47
+ url=https:// github.com/$WORKFLOW/$(gh api repos/$WORKFLOW --jq '.artifacts[0].id')
48
+ commented=$(gh pr view $PR_NUMBER --json comments --jq '.comments[].author.login | select(. | contains("github-actions"))')
49
+ body ="Try the changes in this PR by [side-loading the built extension]($url). :rocket:"
48
50
49
- gh pr comment ${{ github.event.pull_request.number }} --body "$comment"
51
+ if [ -z "$commented" ]; then
52
+ gh pr comment $PR_NUMBER --body "$body"
53
+ else
54
+ gh pr comment $PR_NUMBER --edit-last --body "$body"
55
+ fi
50
56
51
57
publish :
52
58
runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments