mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-13 19:15:48 +00:00
The milestone action currently runs for all merged pull_request_target close events, including PRs opened by bots such as dependabot and ghostty-vouch. That causes milestone binding to run on automated PRs that should be ignored. Gate the update-milestone job so pull request events only run when the author is not a bot, while still allowing closed-issue events to run. This preserves existing issue milestone behavior and prevents bot PRs from triggering the workflow.
34 lines
1.3 KiB
YAML
34 lines
1.3 KiB
YAML
# Description:
|
|
# - Add milestone to a merged PR automatically
|
|
# - Add milestone to a closed issue that has a merged PR fix (if any)
|
|
|
|
name: Milestone Action
|
|
on:
|
|
issues:
|
|
types: [closed]
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
jobs:
|
|
update-milestone:
|
|
# Ignore bot-authored pull requests (dependabot, app bots, etc)
|
|
# and CI-only PRs.
|
|
if: github.event_name == 'issues' || (github.event.pull_request.user.type != 'Bot' && !startsWith(github.event.pull_request.title, 'ci:'))
|
|
runs-on: namespace-profile-ghostty-sm
|
|
name: Milestone Update
|
|
steps:
|
|
- name: Set Milestone for PR
|
|
uses: hustcer/milestone-action@ebed8d5daafd855a600d7e665c1b130f06d24130 # v3.1
|
|
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, 'VOUCHED') && !startsWith(github.event.pull_request.title, 'ci:')
|
|
with:
|
|
action: bind-pr # `bind-pr` is the default action
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Bind milestone to closed issue that has a merged PR fix
|
|
- name: Set Milestone for Issue
|
|
uses: hustcer/milestone-action@ebed8d5daafd855a600d7e665c1b130f06d24130 # v3.1
|
|
if: github.event.issue.state == 'closed'
|
|
with:
|
|
action: bind-issue
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|