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 name: Sync advisories to Linear triage
25 runs-on: ubuntu-latest
26 steps:
27 - name: Checkout repository
28 uses: actions/checkout@v4
29
30 - name: Setup Node.js
31 uses: actions/setup-node@v4
32 with:
33 node-version: 22
34
35 # The built-in GITHUB_TOKEN cannot read repository security advisories
36 # (especially drafts). The Medusa GitHub App must be granted the
37 # "Repository security advisories: Read" permission for this token to
38 # list draft advisories.
39 - name: Generate GitHub App token
40 id: app-token
41 uses: actions/create-github-app-token@v1
42 with:
43 app-id: ${{ secrets.MEDUSA_APP_ID }}
44 private-key: ${{ secrets.MEDUSA_APP_PRIVATE_KEY }}
45
46 - name: Create Linear triage tickets
47 run: node scripts/security-advisories-to-linear.mjs
48 env:
49 GH_TOKEN: ${{ steps.app-token.outputs.token }}
50 LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
51 LINEAR_TEAM_ID: ${{ secrets.LINEAR_TEAM_ID }} # DX team