Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/prompts/review/03-self-improvement.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Both types of prompts can be improved through issue creation.

Use the appropriate channel for different types of feedback:

| Channel | When to Use | Example |
|---------|-------------|---------|
| **PR Review** | Code/issues in the current PR's changes | "Line 42 has a bug" |
| **PR Issue Comment** | Meta-feedback about the PR or process | "This PR needs tests" |
| **Separate Issue** | Prompt improvements beyond current PR | "Add security guidelines" |
| Channel | When to Use | Example |
| -------------------- | --------------------------------------- | ------------------------- |
| **PR Review** | Code/issues in the current PR's changes | "Line 42 has a bug" |
| **PR Issue Comment** | Meta-feedback about the PR or process | "This PR needs tests" |
| **Separate Issue** | Prompt improvements beyond current PR | "Add security guidelines" |

**Key distinction:** Feedback about the PR's code goes in the review. Feedback about prompts goes in a separate issue. Do not mix these.

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/bidirectional-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ jobs:
fi

- name: Verify required configuration
env:
SYNC_PRIVATE_KEY: ${{ secrets.SYNC_PRIVATE_KEY }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good security fix. Moving secrets into environment variables prevents them from appearing in logs if the script encounters errors that echo the command.

APP_ID: ${{ steps.repo.outputs.app_id }}
run: |
if [[ -z "${{ secrets.SYNC_PRIVATE_KEY }}" ]]; then
if [[ -z "$SYNC_PRIVATE_KEY" ]]; then
echo "::error::SYNC_PRIVATE_KEY secret is not set. Please configure it in repo settings."
exit 1
fi
if [[ -z "${{ steps.repo.outputs.app_id }}" ]]; then
if [[ -z "$APP_ID" ]]; then
echo "::error::GitHub App ID variable not set. Configure EXADEV_APP_ID or ADPEAK_APP_ID."
exit 1
fi

- name: Generate GitHub App token for other repo
if: steps.check.outputs.skip != 'true'
uses: tibdex/github-app-token@v2
id: token
with:
Expand All @@ -51,7 +53,6 @@ jobs:

- name: Sync to other repo
id: sync
if: steps.check.outputs.skip != 'true'
env:
TARGET_REPO: ${{ steps.repo.outputs.target }}
TARGET_TOKEN: ${{ steps.token.outputs.token }}
Expand Down Expand Up @@ -84,8 +85,8 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"

if git rebase target/main 2>/dev/null; then
# Rebase successful - push directly to main
git push target HEAD:main
# Rebase successful - push with ci.skip to prevent triggering workflow loop
git push target HEAD:main -o ci.skip

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The -o ci.skip push option doesn't exist in GitHub. To skip workflow triggers, include [skip ci], [ci skip], [no ci], [skip actions], or [actions skip] in commit messages instead.

However, you can't modify commit messages during git rebase of others' commits. This workflow will create an infinite loop: ExaDev pushes → triggers adpeak workflow → adpeak pushes → triggers ExaDev workflow.

You need loop prevention. Options:

  1. Check commit messages for a sync marker (e.g., skip if any commit contains [sync from)
  2. Check if commits were authored by github-actions[bot]
  3. Use a repository variable or separate sync token to detect sync commits
Suggested change
git push target HEAD:main -o ci.skip
# Rebase successful - push directly to main
git push target HEAD:main

echo "skip_pr=true" >> "$GITHUB_OUTPUT"
echo "::notice::Successfully rebased and synced ${COMMITS_BEHIND} commit(s) to ${TARGET_REPO}"
else
Expand Down
4 changes: 4 additions & 0 deletions .husky/post-rewrite
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
# Run lint-staged after git commit --amend or rebase
# This catches formatting issues that pre-commit missed
npx lint-staged

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Correct solution. The pre-commit hook does not run on git commit --amend, so formatting issues can slip through. The post-rewrite hook runs after amends and rebases, catching these issues.

One consideration: this will run lint-staged after every rewritten commit during an interactive rebase, which could slow down multi-commit rebases. This is standard behavior and acceptable.