Skip to content

Conversation

Adez017
Copy link
Member

@Adez017 Adez017 commented Sep 25, 2025

Description

This workflow synchronizes metadata from linked issues into the pull request body, including labels, assignees, and milestones.

Fixes #600

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

Added file for pr-issue-sync.yml

Dependencies

  • List any new dependencies or tools required for this change.
  • Mention any version updates or configurations that need to be considered.

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

This workflow synchronizes metadata from linked issues into the pull request body, including labels, assignees, and milestones.
@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 07:29
Copy link

vercel bot commented Sep 25, 2025

@Adez017 is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation use code recode50 to get free: Mentorship for free.

  2. Get the Ebook for free use code recode at checkout: Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@Adez017 Adez017 requested a review from iitzIrFan September 25, 2025 07:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a GitHub workflow to automatically synchronize metadata (labels, assignees, and milestones) from linked issues into pull request descriptions. The workflow is triggered when PRs are opened, edited, or synchronized.

Key changes:

  • Added automated workflow to parse issue references in PR bodies
  • Implemented metadata extraction and synchronization from linked issues
  • Added PR body updates with formatted metadata blocks

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

uses: actions/github-script@v7
with:
script: |
const issues = JSON.parse(core.getInput("issues"));
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The script attempts to read input 'issues' but it was set as an output in the previous step. This should be steps.extract.outputs.issues instead of core.getInput('issues').

Suggested change
const issues = JSON.parse(core.getInput("issues"));
const issues = JSON.parse(inputs.issues);

Copilot uses AI. Check for mistakes.

let newBody = pr.body || "";

// Remove old metadata block if exists
newBody = newBody.replace(/---\n### Synced Metadata[\s\S]*$/, "");
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The regex pattern searches for 'Synced Metadata' but the actual header being created is 'Synced data from Linked Issues' (line 67). This will result in duplicate metadata blocks being appended instead of replacing the existing one.

Suggested change
newBody = newBody.replace(/---\n### Synced Metadata[\s\S]*$/, "");
newBody = newBody.replace(/---\n### Synced data from Linked Issues[\s\S]*$/, "");

Copilot uses AI. Check for mistakes.


const metadataBlock =
`\n---\n` +
`### Synced data from Linked Issues\n\n` +
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

There are extra spaces between '###' and 'Synced' which creates non-standard markdown formatting. This should be '### Synced data from Linked Issues' with a single space.

Copilot uses AI. Check for mistakes.

@Adez017 Adez017 marked this pull request as draft September 25, 2025 07:36
@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 07:42
@Adez017 Adez017 marked this pull request as ready for review September 25, 2025 07:43
@Adez017
Copy link
Member Author

Adez017 commented Sep 25, 2025

As the Forked doesn't have the permission it will fail here , to test the functionality we need to use hit and trial .

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

uses: actions/github-script@v7
with:
script: |
const issuesInput = core.getInput("issues") || "[]";
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The script tries to get input 'issues' but it should use the output from the previous step. Use steps.extract.outputs.issues instead of core.getInput('issues').

Suggested change
const issuesInput = core.getInput("issues") || "[]";
const issuesInput = process.env.ISSUES || "[]";

Copilot uses AI. Check for mistakes.

with:
script: |
const body = context.payload.pull_request.body || "";
const issuePattern = /#(\d+)/g;
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The regex pattern will match any '#' followed by digits, potentially capturing false positives like '#123' in code snippets or unrelated contexts. Consider using a more specific pattern that looks for common issue linking phrases like 'fixes #123', 'closes #123', or 'resolves #123'.

Suggested change
const issuePattern = /#(\d+)/g;
const issuePattern = /\b(?:fixe?s|close[sd]?|resolve[sd]?)[:\s]+#(\d+)/gi;

Copilot uses AI. Check for mistakes.

Copy link

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
recode-website Ready Ready Preview Comment Sep 27, 2025 1:57am

@sanjay-kv
Copy link
Member

secret with a PAT . have you used this @Adez017

@Adez017
Copy link
Member Author

Adez017 commented Sep 25, 2025

secret with a PAT . have you used this @Adez017

No @sanjay-kv

@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 15:18
@Adez017 Adez017 added the enhancement New feature or request label Sep 25, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

uses: actions/github-script@v7
with:
script: |
const issuesInput = core.getInput("issues") || "[]";
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The core.getInput("issues") call will not retrieve the output from the previous step. It should be steps.extract.outputs.issues to access the output from the extract step.

Suggested change
const issuesInput = core.getInput("issues") || "[]";
const issuesInput = steps.extract.outputs.issues || "[]";

Copilot uses AI. Check for mistakes.

with:
script: |
const body = context.payload.pull_request.body || "";
const issuePattern = /#(\d+)/g;
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The regex pattern /#(\d+)/g will match any #number format, but GitHub's issue linking requires specific keywords like 'fixes', 'closes', 'resolves' followed by the issue number. This could incorrectly match unrelated hash numbers in the PR body.

Suggested change
const issuePattern = /#(\d+)/g;
// Match "fixes #123", "closes: #456", "resolves #789", etc. (case-insensitive)
const issuePattern = /\b(?:fixe?[sd]?|close[sd]?|resolve[sd]?)\s*[: ]+\s*#(\d+)/gi;

Copilot uses AI. Check for mistakes.

@Adez017
Copy link
Member Author

Adez017 commented Sep 25, 2025

secret with a PAT . have you used this @Adez017

mail or anything else ?

@sanjay-kv
Copy link
Member

No my qn was have you used PAT taken for this , if yes which one. Is it the one i sent you before via mail? @Adez017

@Adez017
Copy link
Member Author

Adez017 commented Sep 26, 2025

No my qn was have you used PAT taken for this , if yes which one. Is it the one i sent you before via mail? @Adez017

No i directly used the secrets.GIT_TOKEN which is used in other workflows

@sanjay-kv sanjay-kv merged commit 57944ea into recodehive:main Sep 27, 2025
3 of 4 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in @recode-web Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gssoc25 level 2 30 points

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

💡[Feature]: GitHub Workflow

2 participants