This repository was archived by the owner on Aug 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
108 lines (91 loc) · 3.52 KB
/
Copy pathpull-request.yml
File metadata and controls
108 lines (91 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Pull Request
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit
extension:
name: Extension
uses: ./.github/workflows/extension.yml
secrets: inherit
extension-comment:
name: Comment PR with Extension Artifact
needs: [extension]
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Comment PR
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
const commentMarker = '<!-- extension-download-comment -->'
const commitSha = '${{ github.event.pull_request.head.sha }}'
const commitUrl = '${{ github.event.repository.html_url }}/commit/${{ github.event.pull_request.head.sha }}'
const artifactUrl = '${{ needs.extension.outputs.artifact-url }}'
const commentBody = `${commentMarker}
Built extension for [\`${commitSha}\`](${commitUrl}).
[Download](${artifactUrl})
### Instructions
1. Download the \`extension.zip\` asset from the link below
2. Unzip the downloaded file
#### Chrome
3. Unzip the Chrome directory
4. Open Chrome and navigate to \`chrome://extensions\`
5. Enable \`Developer Mode\` in the top right corner
6. Click \`Load Unpacked\` in the top left corner
7. Select the unzipped Chrome directory
8. Done!
#### Firefox
3. Open your browser and navigate to \`about:debugging#/runtime/this-firefox\`
4. Click \`Load Temporary Add-on...\` in the top right corner
5. Select the zipped Firefox directory
6. Done!`
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})
const existingComment = comments.find((comment) => comment.body.includes(commentMarker))
if (existingComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: commentBody,
})
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: commentBody,
})
}
size:
name: Size
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: write
steps:
- name: Clone repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
submodules: 'recursive'
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Report bundle size
uses: andresz1/size-limit-action@94bc357df29c36c8f8d50ea497c3e225c3c95d1d # master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm