Skip to content

Fixes #260: [Fleet Execution] Implement Next.js Page Integration Agent Skill #90

Fixes #260: [Fleet Execution] Implement Next.js Page Integration Agent Skill

Fixes #260: [Fleet Execution] Implement Next.js Page Integration Agent Skill #90

Workflow file for this run

name: Fleet Label PR
on:
pull_request:
types: [opened, edited, synchronize]
permissions:
pull-requests: write
issues: read
jobs:
label_pr:
runs-on: ubuntu-latest
steps:
- name: Check linked issue and apply label/milestone
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
REPO: ${{ github.repository }}
run: |
# Use GitHub's own closing keyword resolution to find linked issues
ISSUE_NUMBER=$(gh pr view "$PR_URL" --json closingIssuesReferences --jq '.closingIssuesReferences[0].number // empty')
if [ -z "$ISSUE_NUMBER" ]; then
echo "No closing issue reference found on this PR. Exiting."
exit 0
fi
echo "Found linked issue: #$ISSUE_NUMBER"
# Check if the linked issue has the 'fleet' label
HAS_FLEET=$(gh issue view "$ISSUE_NUMBER" --repo "$REPO" --json labels --jq '[.labels[].name] | any(. == "fleet")')
if [ "$HAS_FLEET" = "true" ]; then
echo "Linked issue has 'fleet' label. Applying 'fleet-merge-ready' to PR."
gh pr edit "$PR_URL" --add-label "fleet-merge-ready"
# Check if linked issue has a milestone and copy it
MILESTONE_TITLE=$(gh issue view "$ISSUE_NUMBER" --repo "$REPO" --json milestone --jq '.milestone.title // empty')
if [ -n "$MILESTONE_TITLE" ]; then
echo "Applying milestone '$MILESTONE_TITLE' to PR."
gh pr edit "$PR_URL" --milestone "$MILESTONE_TITLE"
fi
else
echo "Linked issue does not have 'fleet' label. Ignoring."
fi