Skip to content

docs: add ci-watcher hook example#18

Merged
chsm04 merged 1 commit intomainfrom
docs/ci-watcher-example
Mar 25, 2026
Merged

docs: add ci-watcher hook example#18
chsm04 merged 1 commit intomainfrom
docs/ci-watcher-example

Conversation

@chsm04
Copy link
Copy Markdown
Owner

@chsm04 chsm04 commented Mar 25, 2026

Summary

  • examples/ci-watcher.sh 추가 — GitHub Actions CI 결과를 Pulse로 알려주는 hook 스크립트
  • README 영문/한글의 CI/CD 예시를 실제 스크립트 참조로 교체
  • deprecated CLAUDE_CODE_SSE_PORT 환경변수 항목 제거

Test plan

  • TypeScript check 통과
  • ci-watcher.sh 실행 확인

🤖 Generated with Claude Code

- Add examples/ci-watcher.sh with full documentation and setup guide
- Replace inline CI/CD hook snippet with reference to example script
- Remove deprecated CLAUDE_CODE_SSE_PORT from configuration docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chsm04 chsm04 merged commit 15a8f0e into main Mar 25, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0700cad4a0

ℹ️ 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".

Comment thread examples/ci-watcher.sh
Comment on lines +152 to +153
RUNS_JSON=$(gh run list --repo "$REPO" --commit "$SHA" --created ">=$START_TIME" \
--json databaseId,name,status,conclusion --limit 50 2>/dev/null || echo "[]")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop filtering out pre-existing runs for the same commit

The polling query uses gh run list --commit "$SHA" --created ">=$START_TIME", where START_TIME is captured only when this hook starts. Since gh run list --created filters by run creation time, any workflow run that was created during/just before git push completion is excluded even though it belongs to the pushed commit. In that scenario the watcher can miss all relevant runs and eventually time out without sending pass/fail notifications.

Useful? React with 👍 / 👎.

Comment thread examples/ci-watcher.sh
# Only trigger on gh pr create or git push (not --delete)
if echo "$CMD" | grep -qE "gh pr create"; then
:
elif echo "$CMD" | grep -qE "git push" && ! echo "$CMD" | grep -qE "--delete|-d"; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat --delete as a grep pattern, not an option

The delete-push guard calls grep -qE "--delete|-d", but because the pattern starts with -, grep parses it as an option, errors, and returns non-zero. With the surrounding ! ..., that failure becomes truthy, so git push --delete is incorrectly treated as a normal push and starts CI watching. Add an option terminator (for example grep -qE -- "--delete|-d") so delete pushes are actually excluded.

Useful? React with 👍 / 👎.

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