Address review feedback: always set both go and toolchain
directives via go mod edit, then let go mod tidy normalize.
This eliminates complex conditional toolchain handling.
Additional fixes:
- Add go mod tidy after edits to reconcile dependencies
- Commit go.sum alongside go.mod
- Filter PR search to open PRs only (--state open)
- Use GITHUB_REPOSITORY for repo instead of hardcoding
- Use git diff to detect no-op bumps post-tidy
- Read go.mod state via go mod edit -json instead of grep
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The jq -r flag with // "" operator already returns empty string
for null/missing values, never the literal string "null".
The checks for == "null" are unnecessary.
Co-authored-by: babakks <36728931+babakks@users.noreply.github.com>
Replace manual parsing and editing with go mod edit:
- Use 'go mod edit -json' to read current go and toolchain directives
- Use 'go mod edit -go' to update go directive
- Use 'go mod edit -toolchain' to update toolchain directive
- Remove manual sed/grep parsing and .bak file handling
- More reliable and maintainable than custom text manipulation
Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
- Clarify comment to say "matches" instead of "matches or exceeds"
- Update PR body to accurately reflect final go.mod state
- Show actual toolchain if present, or note it's not specified
- Provide clear explanation when toolchain is omitted
Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
- Compare major.minor versions instead of exact string match
- Preserve go directive if already at latest major.minor
- Handle cases where go.mod has full patch version (e.g., 1.25.6)
- Update PR body to use actual go directive from modified go.mod
- Add detailed comments explaining version handling logic
Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
- Add early trap setup to avoid exit code issues
- Handle missing toolchain directive gracefully with `|| true`
- Add logic to detect when toolchain is expected to be missing
- Add informative messages about missing toolchain
- Implement smart toolchain handling:
- Skip toolchain when go version matches latest (redundant)
- Add toolchain when go version is older than latest
- Update toolchain when it exists but is outdated
Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
Replace prauto.yml and pr-help-wanted.yml with a single
triage-pull-requests.yml that calls shared reusable workflows from
desktop/gh-cli-and-desktop-shared-workflows:
- triage-label-external-pr: labels external PRs with external,needs-triage
- triage-close-from-default-branch: closes PRs opened from trunk
- triage-pr-requirements: enforces body length + help-wanted issue linkage
- triage-close-no-help-wanted: closes PRs labeled no-help-wanted-issue
- triage-ready-for-review: removes needs-triage on ready-for-review label
Also adds a daily schedule to auto-close PRs with unmet requirements
after 7 days.
Deletes:
- prauto.yml
- pr-help-wanted.yml
- scripts/check-help-wanted.sh
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes#11408
These changes enhance the GitHub CLI spam detection logic to automatically comment on and close suspected spam based on the past weeks of usage.
Additionally, there were a few minor enhancements to the script, allowing it to be executed from anywhere rather than the root of the local repository.
* ci: improve spam detection evals
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* ci: make test case names consistent
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* ci: remove ill-indented/redundant test case
Signed-off-by: Babak K. Shandiz <babakks@github.com>
---------
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Add workflow_dispatch support to PR Help Wanted check
This update allows the PR Help Wanted workflow to be triggered manually via workflow_dispatch with a specified PR URL. It adds logic to fetch PR details using the GitHub CLI for manual runs and unifies variable handling for both event types.
* Update workflow to use PR number instead of URL
Changed the workflow_dispatch input from 'pr_url' to 'pr_number' and updated the script to construct the PR URL from the number.
* Move help-wanted check for draft PRs into script
* Don't prefix URL with `#`
* Invert draft checking logic
Inverting this logic because anything other than "false" means we should skip it.
* Move PR draft status check to shell script
The logic for checking if a pull request is a draft has been moved from the GitHub Actions workflow YAML to the check-help-wanted.sh script. This simplifies the workflow file and centralizes the draft status check within the script.
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
Co-authored-by: Andy Feller <andyfeller@github.com>