Skip to content

Conversation

@roshankumar0036singh
Copy link
Contributor

Pull Requests Review Criteria

Caution

PRs that fail to meet these review standards will be automatically flagged and may be rejected by maintainers.

  • Filled out this PR template properly
  • Did not commit directly to main
  • Limited commits (max 3–4 unless permitted by Admin/Mentors)
  • Added comments in complex parts of code

Closes:
closes #1072

Describe the add-ons or changes you've made 📃

I have implemented a comprehensive GitHub Issue Automation system to streamline contribution management.

Key Features:

  1. Auto-Assignment: Automatically assigns issues to creators if they select "Yes" in the issue form.
  2. /assign Command: Allows contributors to claim issues by commenting /assign.
  3. Deadline Enforcement: A daily schedule checks assigned issues and manages timeouts based on priority:
    • High: 3 days
    • Medium: 6 days
    • Low: 8 days
    • Includes warning messages 24h before timeout.
  4. Assignment Limits: Prevents users from hoarding more than 2 issues at a time.

Files Added:

  • .github/workflows/issue-automation.yml: Defines triggers (issues, comments, schedule).
  • .github/scripts/issue-automation.js: Contains the logic for assignment and deadline checks.

Screenshots 📷

Screenshot 2026-01-24 134942 Screenshot 2026-01-24 134953

The logic has been verified using a local test harness to mock GitHub events. The workflow requires issues: write permissions which have been added.

@vercel
Copy link

vercel bot commented Jan 24, 2026

@roshankumar0036singh is attempting to deploy a commit to the avdheshvarshney's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

@roshankumar0036singh
Copy link
Contributor Author

roshankumar0036singh commented Jan 24, 2026

@Avdhesh-Varshney plz review it i couldnt test the functionality so just tested it locally by creating test file and mimicing the github triggers

Copy link
Collaborator

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

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

Great work. Need to check whether we can process the github project using this workflow. https://github.com/orgs/Code-A2Z/projects/1


await assignUser(issue.number, username);
await addLabels(issue.number, ['Status: Assigned']);
await removeLabel(issue.number, 'up-for-grabs');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just assign to user, Don't add labels.
If possible to update the status of issue in OS - TASK TRACKER (view), try to update.


const username = issue.user.login;

if (await checkUserAssignmentLimit(username)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Create variable for await. It may breaks the if condition as promise is always true


const username = comment.user.login;

if (await checkUserAssignmentLimit(username)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here


await assignUser(issue.number, username);
await addLabels(issue.number, ['Status: Assigned']);
await removeLabel(issue.number, 'up-for-grabs');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove labels


// Handle Scheduled Deadline Checks
if (context.eventName === 'schedule') {
// Fetch all open issues with 'Status: Assigned'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try to fetch from OS - TASK TRACKER (view) project. Otherwise check all opened issues.

const warningDate = new Date(deadline);
warningDate.setDate(deadline.getDate() - 1);

const assignee = issue.assignees.length > 0 ? issue.assignees[0].login : null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you check the latest contributor is always at 0th index?
Or can we not get it from events variable? (That to be more accurate)


if (labels.includes('priority: high')) daysAllowed = 3;
else if (labels.includes('priority: medium')) daysAllowed = 6;
else if (labels.includes('priority: low')) daysAllowed = 8;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check able to check the priority from OS - TASK TRACKER (view) project?

And also check is it possible to set start date and end date of the issue, according to How much time should be allocated to this issue? question in issue template.

Feel free to modify the issue template to update setup this workflow.


on:
issues:
types: [opened, edited, reopened, assigned, unassigned]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove assigned and unassigned events

@roshankumar0036singh
Copy link
Contributor Author

@Avdhesh-Varshney check now i have tried to use the os tracker but we need to test it one time as i cant test it locally

@Avdhesh-Varshney
Copy link
Collaborator

@roshankumar0036singh Your earlier contribution was awesome. Please keep the same consistency.
I've reviewed these updated changes. These all are written using AI and you have not gone through github project tracker at once.

Focus on quality contribution not on quantity. Please atleast read & review your code on your own first.
Later, I'll review and test the workflow.

@roshankumar0036singh
Copy link
Contributor Author

roshankumar0036singh commented Jan 25, 2026

@Avdhesh-Varshney i worked on it but currently it is using the github token which normally cant wrtie to the organisation level project we might need to use pat

@Avdhesh-Varshney
Copy link
Collaborator

@roshankumar0036singh pat? - personal token?

If personal token, do you say We need to write it hard-coded in workflow? or need to setup in settings?

@roshankumar0036singh
Copy link
Contributor Author

roshankumar0036singh commented Jan 25, 2026

@Avdhesh-Varshney need to setup as a New repository secret in settings and whatever name you used for it give me that name

@roshankumar0036singh
Copy link
Contributor Author

token is encrypted in GitHub's secret storage ,It's never visible in logs or code

@Avdhesh-Varshney
Copy link
Collaborator

CODE_A2Z_ORG_FINE_GRAINED_PAT_FOR_ASSIGN_WORKFLOW

@roshankumar0036singh
Copy link
Contributor Author

@Avdhesh-Varshney need this scopes for pat project , read and write and did you added it as a Repository Secret

@Avdhesh-Varshney
Copy link
Collaborator

Addedas repository secret.
But wait confirming with project read and write permissions

@roshankumar0036singh
Copy link
Contributor Author

@Avdhesh-Varshney check now there was slight issue this code formating issue if from earlier commit made to the code-a2z repo not by my commit

- Auto-assign issues when users select 'Yes' in issue form
- Support /assign command for manual assignment
- Enforce 2-issue limit per user
- Daily deadline checks with priority-based timeouts (3/6/8 days)
- Warning notifications 24h before deadline
- Project V2 integration with OS - TASK TRACKER
- Idempotent project sync with status updates
- Comprehensive error handling and logging
- Production-ready workflow with timeouts and concurrency control
- Auto-assign issues when users select 'Yes' in issue form
- Support /assign command for manual assignment
- Enforce 2-issue limit per user
- Daily deadline checks with priority-based timeouts (3/6/8 days)
- Warning notifications 24h before deadline
- Project V2 integration with OS - TASK TRACKER
- Idempotent project sync with status updates
- Comprehensive error handling and logging
- Production-ready workflow with timeouts and concurrency control
@Avdhesh-Varshney
Copy link
Collaborator

@roshankumar0036singh Yes that was due to some earlier commits.
Leave that workflow check for this PR.

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.

Workflow to Assign assignees on issues

2 participants