-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 2.03 KB
/
Copy pathnotify-package-changes.yml
File metadata and controls
58 lines (52 loc) · 2.03 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
name: Notify package changes
# Fires on PRs to dev that touch shared workspaces (packages, workspace,
# turbo.json, root package.json). Posts a single sticky comment listing the
# apps that depend on the changed code (discovered from apps/*/package.json),
# their owners (from CODEOWNERS entries, when active), and a dispatch link
# for the Deploy to Amplify workflow. The comment never triggers a deploy.
#
# The comment is "sticky" via marocchino/sticky-pull-request-comment with the
# header `package-deploy-impact`. Subsequent runs on the same PR update the
# same comment in place rather than stacking.
#
# pnpm-lock.yaml is deliberately excluded from the trigger paths.
#
# Markdown-only edits (READMEs etc.) under any watched path are excluded, so a
# docs-only change inside packages/ does not ping app owners.
on:
pull_request:
branches: [dev]
paths:
- "packages/**"
- "pnpm-workspace.yaml"
- "turbo.json"
- "package.json"
- "!**/*.md"
- "!**/*.mdx"
permissions:
contents: read
pull-requests: write
jobs:
notify:
name: Compute and post sticky comment
runs-on: ubuntu-latest
steps:
# Ubuntu runners ship with Node already, and the script only uses Node
# built-ins. We deliberately do NOT use actions/setup-node here because
# its Corepack auto-detection trips over the root package.json's
# `packageManager: pnpm@<v>` field with `Unable to locate executable
# file: pnpm`. The script needs no pnpm.
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Compute affected apps and render comment
id: compute
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: node .github/scripts/compute-affected-apps.mjs
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: package-deploy-impact
message: ${{ steps.compute.outputs.markdown }}