Skip to content

chore: merge status sync - #165

Merged
EmilieFo17 merged 3 commits into
mainfrom
chore/pr-merge-status-sync
Jul 24, 2026
Merged

chore: merge status sync#165
EmilieFo17 merged 3 commits into
mainfrom
chore/pr-merge-status-sync

Conversation

@EmilieFo17

Copy link
Copy Markdown
Contributor

Proposed changes

Adds a new composite GitHub Action .github/actions/sync-status-on-merge which, when a pull request is merged, updates the status (Project v2 OpenAEV-Platform/openaev#2) of the linked issue depending on whether the feature-flag label is present:

  • With feature-flag: In review → Test PO main-ff, then Ready to remove FF → Final product validation (with close + solved label + 0. Candidate milestone).
  • Without feature-flag: Ready to merge → Final product validation (with close + solved label + 0. Candidate milestone), then In Review -> Done (with close + solved label + 0. Candidate milestone).
    Adds the .github/workflows/openaev-sync-status-on-merge.yml workflow, triggered on pull_request: closed (PR merged) and on workflow_dispatch (manual mode with pr_number).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds automation to synchronize GitHub Project v2 “Status” for issues referenced by merged PRs, including closing/labeling and milestone assignment, and wires it up to run on PR merge and on manual dispatch.

Changes:

  • Added a workflow to run the status sync on pull_request: closed (merged) and via workflow_dispatch with a pr_number input.
  • Added a composite action that detects issue numbers from PR title/body, updates Project v2 Status, and optionally closes/issues-labels/milestones.
  • Removed the prior “move closed issue to milestone” workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
.github/workflows/sync-status-on-merge.yml New workflow entrypoint that generates a GitHub App token and invokes the local composite action on PR merge/manual runs.
.github/actions/sync-status-on-merge/action.yml Composite action implementing issue detection + Project v2 Status transitions + optional close/label/milestone operations.
.github/workflows/move-closed-issue-to-milestone.yml Removes previous milestone automation that ran on issue close events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


jobs:
sync-status:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
@@ -0,0 +1,37 @@
name: "[OpenAEV] Sync Project Status on PR Merge"
Comment on lines +24 to +35
env:
GH_TOKEN: ${{ inputs.token }}
OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
PR_NUMBER_INPUT: ${{ inputs.pr-number }}
PR_JSON: ${{ toJson(github.event.pull_request) }}
run: |
set -euo pipefail

if [ -n "$PR_NUMBER_INPUT" ]; then
PR_JSON=$(gh pr view "$PR_NUMBER_INPUT" --repo "$OWNER/$REPO_NAME" --json title,body)
fi
TITLE_NUMS=$(echo "$TITLE_REF" | grep -oP '\d+')
fi

KEYWORD_NUMS=$(echo "$FULLTEXT" | grep -oiP '(close[sd]?|fix(es|ed)?|resolve[sd]?)\s*:?\s*#\d+' | grep -oP '\d+' || true)
Comment on lines +80 to +83
PROJECT_ID=$(echo "$RESULT" | jq -r '.data.organization.projectV2.id')
FIELD_ID=$(echo "$RESULT" | jq -r '.data.organization.projectV2.field.id')
OPTIONS_JSON=$(echo "$RESULT" | jq -c '.data.organization.projectV2.field.options')

continue
fi

OPTION_ID=$(echo "$OPTIONS_JSON" | jq -r --arg name "$NEW_STATUS" '.[] | select(.name == $name) | .id')
Comment on lines +195 to +200
if [ "$CLOSE_ISSUE" == "true" ]; then
gh issue edit "$ISSUE_NUM" --repo "$OWNER/$REPO_NAME" --add-label "solved"
echo "✅ \"solved\" label added."
gh issue close "$ISSUE_NUM" --repo "$OWNER/$REPO_NAME"
echo "✅ Issue closed."
fi
@@ -0,0 +1,214 @@
name: 'Sync Project Status on PR Merge'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@EmilieFo17
EmilieFo17 merged commit 1c60271 into main Jul 24, 2026
24 of 25 checks passed
@EmilieFo17
EmilieFo17 deleted the chore/pr-merge-status-sync branch July 24, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants