|
1
|
name: Security Advisories to Linear |
|
2
|
|
|
3
|
# Creates a triage ticket in the DX Linear team for each TRIAGE-state repository |
|
4
|
# security advisory (reported at github.com/medusajs/medusa/security/advisories). |
|
5
|
# |
|
6
|
# Triage advisories are not delivered by the `repository_advisory` event (that only |
|
7
|
# fires on published/reported), so they are only reachable by polling the REST API. |
|
8
|
# Dedup is handled in the script, so daily runs never create duplicate tickets. |
|
9
|
|
|
10
|
on: |
|
11
|
schedule: |
|
12
|
- cron: "0 8 * * *" # Every day at 08:00 UTC |
|
13
|
workflow_dispatch: # Allow manual trigger |
|
14
|
|
|
15
|
permissions: |
|
16
|
contents: read |
|
17
|
|
|
18
|
concurrency: |
|
19
|
group: security-advisories-to-linear |
|
20
|
cancel-in-progress: false |
|
21
|
|
|
22
|
jobs: |
|
23
|
sync: |
|
24
|
# Upstream-only Linear/App integration; skip safely in this independent fork. |
|
25
|
if: github.repository == 'medusajs/medusa' |
|
26
|
name: Sync advisories to Linear triage |
|
27
|
runs-on: ubuntu-latest |
|
28
|
steps: |
|
29
|
- name: Checkout repository |
|
30
|
uses: actions/checkout@v4 |
|
31
|
|
|
32
|
- name: Setup Node.js |
|
33
|
uses: actions/setup-node@v4 |
|
34
|
with: |
|
35
|
node-version: 22 |
|
36
|
|
|
37
|
# The built-in GITHUB_TOKEN cannot read repository security advisories |
|
38
|
# (especially drafts). The Medusa GitHub App must be granted the |
|
39
|
# "Repository security advisories: Read" permission for this token to |
|
40
|
# list draft advisories. |
|
41
|
- name: Generate GitHub App token |
|
42
|
id: app-token |
|
43
|
uses: actions/create-github-app-token@v1 |
|
44
|
with: |
|
45
|
app-id: ${{ secrets.MEDUSA_APP_ID }} |
|
46
|
private-key: ${{ secrets.MEDUSA_APP_PRIVATE_KEY }} |
|
47
|
|
|
48
|
- name: Create Linear triage tickets |
|
49
|
run: node scripts/security-advisories-to-linear.mjs |
|
50
|
env: |
|
51
|
GH_TOKEN: ${{ steps.app-token.outputs.token }} |
|
52
|
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }} |
|
53
|
LINEAR_TEAM_ID: ${{ secrets.LINEAR_TEAM_ID }} # DX team |