Skip to content

Commit 8601c9c

Browse files
authored
chore: add downloadable bot comment (#228)
1 parent e6dd90a commit 8601c9c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/release.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ jobs:
3838
name: extension-${{ github.sha }}
3939
path: workspace/extension/build/svelte-devtools.zip
4040

41+
- if: github.event_name == 'pull_request'
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
PR_NUMBER: ${{ github.event.number }}
45+
WORKFLOW: ${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts
46+
run: |
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:"
50+
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
56+
4157
publish:
4258
runs-on: ubuntu-latest
4359
needs: [manifest, bundle]

0 commit comments

Comments
 (0)