Skip to content

Commit

Permalink
Update project_assigned_verify.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayank77maruti authored Dec 16, 2024
1 parent e8418d0 commit 8037973
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/project_assigned_verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ jobs:
script: |
const issueNumber = context.issue.number;
// Fetch all open projects in the repository
# Fetch all open projects in the repository
const projects = await github.rest.projects.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
});
// Filter to get only open projects
# Filter to get only open projects
const assignedProjects = projects.data.filter(project => project.state === 'open');
if (assignedProjects.length !== 1) {
console.warn(`Issue must be assigned to exactly one open project. Found: ${assignedProjects.length}`);
// Add a comment to notify about incorrect project assignment
# Add a comment to notify about incorrect project assignment
const existingComments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -64,5 +64,3 @@ jobs:
} else {
console.log(`Valid project assignment: ${assignedProjects[0].name}`);
}

0 comments on commit 8037973

Please sign in to comment.