Skip to content

chore(ci): add edited trigger to check-sprint and auto-add workflows#57

Open
lml2468 wants to merge 1 commit into
mainfrom
chore/sprint-workflow-edited-trigger
Open

chore(ci): add edited trigger to check-sprint and auto-add workflows#57
lml2468 wants to merge 1 commit into
mainfrom
chore/sprint-workflow-edited-trigger

Conversation

@lml2468
Copy link
Copy Markdown
Contributor

@lml2468 lml2468 commented May 27, 2026

This PR adds the edited event to the pull_request_target.types trigger in both check-sprint.yml and auto-add-to-project.yml, enabling the Issue-first Sprint check flow to work correctly when a developer adds a Closes #<issue> reference to a PR description after opening.

@lml2468 lml2468 requested a review from a team as a code owner May 27, 2026 10:15
@github-actions github-actions Bot added the size/XS PR size: XS label May 27, 2026
Copy link
Copy Markdown
Contributor Author

@lml2468 lml2468 left a comment

Choose a reason for hiding this comment

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

[COMMENT] Correct and safe β€” adding edited trigger to metadata-only workflows.

βœ… Both workflows use pull_request_target without checking out PR code β€” no security concern with the edited trigger.
βœ… actionlint passes β€” trigger syntax is valid.
βœ… Logic is sound: re-running sprint check and auto-add when PR description is edited enables the issue-first workflow (adding Closes #N after initial open).

πŸ’¬ CI notes (not blocking):

  • check-sprint fails because Sprint is not set on the project board (unrelated to code).
  • welcome fails due to the permissions bug fixed in PR #55 (pending merge).

⚠️ Cannot approve: PR author and review account are the same (lml2468). Needs another maintainer's approval.

Copy link
Copy Markdown

@yujiawei yujiawei left a comment

Choose a reason for hiding this comment

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

Code Review β€” PR #57 (octo-admin)

1. Verdict Summary

This PR adds the edited event type to pull_request_target triggers in two CI workflows so that the Issue-first Sprint check re-evaluates when a developer fills in Closes #<issue> after opening a PR. The change is small (2 additions / 2 deletions), well-scoped, and addresses a real gap in the existing trigger set.

Item Status Note
Correctness β€” solves stated problem βœ… edited fires on PR title/body changes, which is exactly when a Closes #N reference would be added post-open
Security under pull_request_target βœ… Top-level permissions: {}; no PR-head checkout; delegates to org reusable workflow with explicit secret
Branch / scope filters preserved βœ… branches: [main] in check-sprint.yml retained; only base-branch=main PRs are affected
YAML syntax / formatting βœ… Valid; only the types: array expanded
Doc consistency with new trigger ⚠️ The KNOWN LIMITATION comment in check-sprint.yml still lists (opened, synchronize, reopened) as the trigger set; now stale post-merge

2. Findings

P0 / P1 β€” none

No correctness, security, or data-loss issues identified.

P2 β€” Stale documentation comment in check-sprint.yml

.github/workflows/check-sprint.yml:9 contains a multi-line KNOWN LIMITATION block that explicitly enumerates the old trigger set:

This check re-evaluates only on pull_request_target events (opened, synchronize, reopened).

After this PR, the trigger list at line 36 is [opened, synchronize, reopened, edited], so the comment is no longer accurate. Worth updating in the same PR (or a quick follow-up) to mention edited and to note that PR-body edits (e.g. adding Closes #N) now also re-trigger the check. Not a merge blocker β€” purely a documentation drift nit.

Suggested edit (illustrative):

# This check re-evaluates on pull_request_target events
# (opened, synchronize, reopened, edited). The `edited` trigger
# covers post-open PR description changes such as adding a
# `Closes #<issue>` reference.

Maintainability / suggestion (non-blocking)

  • auto-add-to-project.yml adds edited alongside opened. The PR description focuses on the Closes #N flow for the sprint check; for the auto-add workflow, edited typically only matters if the reusable workflow does additional work beyond initial project membership (e.g. re-syncing fields based on body content). If it just adds-to-project once and is a no-op on subsequent calls, the trigger is harmless but adds noise. A one-liner in the PR description clarifying the intent for auto-add-to-project would be helpful for future readers.

3. Notes

  • pull_request_target semantics are correct here: it runs with base-branch workflow definitions and base-branch secrets, no PR-fork code is checked out, so adding event types does not widen the attack surface.
  • Increased fire frequency from edited is bounded β€” PR title/body edits are infrequent compared to pushes β€” and the downstream reusable workflows are short.
  • Head SHA verified: 72b094df253e4604e4928009fa8c6eba2cd4634e. Files at this SHA match the diff posted on the PR.

4. Recommendation

Approving. The doc-comment drift in check-sprint.yml is worth fixing but does not need to block merge; it can be done in this PR or a trivial follow-up.

Copy link
Copy Markdown

@Jerry-Xin Jerry-Xin left a comment

Choose a reason for hiding this comment

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

Summary: This PR is relevant to the repository and the trigger change correctly supports re-running the sprint/project automation when a PR body is edited.

πŸ’¬ Non-blocking

  • πŸ”΅ Suggestion: .github/workflows/check-sprint.yml:8 The header comment still says the workflow re-evaluates only on opened, synchronize, reopened; it should include edited to stay accurate after this change.

βœ… Highlights

  • πŸ”΅ The PR is in scope: it updates repo-owned CI automation for PR/project workflow behavior.
  • πŸ”΅ The pull_request_target usage remains consistent with the existing security posture: no PR code is checked out or executed in these wrapper workflows.
  • πŸ”΅ No tests are necessary for this small workflow trigger-only change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants