Skip to content

Add Slack notifications for docs-gh channel - #1317

Merged
jth-nw merged 8 commits into
mainfrom
dev
Aug 4, 2026
Merged

Add Slack notifications for docs-gh channel #1317
jth-nw merged 8 commits into
mainfrom
dev

Conversation

@jth-nw

@jth-nw jth-nw commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

jth-nw and others added 8 commits August 4, 2026 12:27
Posts to #docs-gh via SLACK_WEBHOOK_URL whenever the dev->main sync
succeeds/fails/conflicts, a PR is created/commented/review-requested,
or an issue is created/commented on. CODEOWNERS teams are resolved via
CODEOWNERS (PRs) or label-codeowners.json (issues) and mapped to Slack
member IDs through the new .github/team-slack-map.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…notify workflows

CodeQL flagged steps.resolve-teams.outputs.teams being interpolated
directly into a run: block in slack-notify-pr.yml — a PR that edits
.github/CODEOWNERS could inject shell syntax that executes with the
job's secrets in scope. Pass the dynamic values through env: instead.
Applied the same defensive pattern to slack-notify-issue.yml.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- resolve-codeowners-teams.mjs: match non-wildcard CODEOWNERS patterns
  recursively regardless of trailing slash, fixing missed matches for
  /static/images/training and /static/images/customer-portal
- slack-notify-issue.yml: don't skip notification when labels haven't
  landed yet (auto-labeling race); post without a team mention instead
- slack-notify-pr.yml: skip the Slack step cleanly on fork PRs, which
  lack SLACK_WEBHOOK_URL under pull_request by design

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Exclude bot-authored issue_comment events from both Slack workflows to
  stop automated tooling comments (Vale autofix, Claude reviewers, etc.)
  from generating Slack pings
- slack-notify-pr.yml: checkout the PR base sha instead of the head/merge
  ref so a fork PR can't get its own modified resolver script or
  CODEOWNERS executed with repo permissions
- Document the resolver's lack of glob/wildcard support in CODEOWNERS
  matching

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 30-minute wait was too tight for build+deploy runs that take
~30 minutes on their own, causing sync-dev-to-main to time out even
though the build eventually succeeded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…fy workflows

- slack-notify-pr.yml: read changed-file paths into a bash array via
  mapfile instead of unquoted command substitution, so paths with
  spaces or glob characters aren't split/expanded before reaching the
  resolver script
- slack-notify-issue.yml: pass issue/comment URLs through env vars
  instead of inline ${{ }} interpolation in the run: block, matching
  the pattern already used in slack-notify-pr.yml

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Switch the PR-open/review-requested triggers to pull_request_target so
the job has secrets and a write-scoped token for fork PRs too. Checkout
stays pinned to the base ref and nothing reads or executes fork-supplied
code, so this doesn't reintroduce the fork-secrets risk pull_request_target
is normally flagged for.

- Fork PRs now get the same Slack "PR created" notification (with
  CODEOWNERS mention) that same-repo PRs already got
- Fork PRs additionally get a plain PR comment tagging the resolved
  CODEOWNERS teams, since fork contributors/reviewers may not be in Slack

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add Slack notifications for docs-gh channel
@jth-nw
jth-nw merged commit 03d2851 into main Aug 4, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant