[🎨 Design System] Slack notification on DS changes#1902
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab53a99c12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # 변경된 디렉토리 목록 (foundation/color, foundation/typography 등) | ||
| CHANGED_DIRS=$(git diff --name-only $BASE_SHA...$HEAD_SHA -- 'packages/design-system/src/' \ | ||
| | grep -E '(components|foundation|theme)/' \ | ||
| | sed -E 's|packages/design-system/src/(components|foundation|theme)/([^/]+)/.*|\1/\2|' \ |
There was a problem hiding this comment.
Fix invalid sed delimiter in path normalization
The sed expression uses | as the substitution delimiter while also using unescaped alternation (components|foundation|theme) inside the pattern, which GNU sed parses as a malformed command (unknown option to 's'). That breaks directory normalization for changed files (and in bash -o pipefail will fail the step), so the workflow can emit empty/incorrect component info or stop before sending notifications.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
모바일과 동일하게 카테고리별 별도 sed 패턴으로 분리하여 구분자 충돌 해결했습니다.
| | sed -E 's|packages/design-system/src/(components|foundation|theme)/([^/]+)/.*|\1/\2|' \ | ||
| | sort -u) |
There was a problem hiding this comment.
Handle root-level theme files in component extraction
The normalization pattern assumes paths always look like .../(components|foundation|theme)/<name>/..., but this package has files directly under packages/design-system/src/theme/ (for example theme/index.ts). Those paths are not normalized and later parsing (cut -d/ -f1/-f2) derives wrong component names/Storybook URLs, so theme-only updates generate misleading Slack headers and links.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
theme 루트 파일(theme/index.ts 등)도 theme으로 정규화되도록 패턴 추가했습니다.
Storybook 배포 완료🔗 미리보기: https://chainapsis.github.io/keplr-wallet/storybook/ Last updated: 2026-03-30T05:34:28Z |
piatoss3612
left a comment
There was a problem hiding this comment.
Shell injection — ${{ }} 직접 보간
${{ github.event.head_commit.message }}가 셸 스크립트에 텍스트 치환으로 삽입되고 있어서, 커밋 메시지에 셸 메타문자가 포함되면 임의 명령 실행이 가능합니다. 같은 step에 SLACK_WEBHOOK_URL env가 있어서 webhook URL 유출 경로가 됩니다.
github.event.head_commit.url도 동일 패턴입니다.
현재 코드 (line 161, 168):
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
PR_LINK="<${{ github.event.head_commit.url }}|${COMMIT_SHORT_SHA}>"수정 제안:
env:
SLACK_WEBHOOK_URL: ${{ secrets.DS_NOTIFICATION_SLACK_WEBHOOK_URL }}
COMMIT_MSG: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
run: |
# ...
PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K\d+' | head -1)
# ...
PR_LINK="<${COMMIT_URL}|${COMMIT_SHORT_SHA}>"env: 블록으로 넘기면 셸 변수로 안전하게 참조됩니다.
Separate sed patterns per category to avoid | delimiter collision with alternation. Handle theme root files (e.g. theme/index.ts) that have no subdirectory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Map foundation → foundations (plural) for Storybook path - Use /docs/ path for stable component links Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move head_commit.message and head_commit.url to env block to avoid direct shell interpolation of untrusted input. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…re built-in) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ca80f25 to
a78bf1c
Compare
Summary
DS 변경 시 Slack 알림 자동화
packages/design-system/src/변경이 push되면 Slack 채널에 알림 전송필요 시크릿 -> 정환님이 등록 완료 ✅
ANTHROPIC_API_KEY_FOR_DS— Claude API 호출용DS_NOTIFICATION_SLACK_WEBHOOK_URL— Slack webhook URLTest plan
ok응답)🤖 Generated with Claude Code