Skip to content

feat: integrate retry mechanisms and improvements into Factory AI wor… #29

feat: integrate retry mechanisms and improvements into Factory AI wor…

feat: integrate retry mechanisms and improvements into Factory AI wor… #29

Workflow file for this run

name: 🤖 Auto-Assign Issues & PRs

Check failure on line 1 in .github/workflows/auto-assign.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/auto-assign.yml

Invalid workflow file

(Line: 82, Col: 9): Unrecognized named-value: 'secrets'. Located at position 75 within expression: (github.event_name == 'issues' || github.event_name == 'pull_request') && secrets.PROJECT_TOKEN != ''
on:
issues:
types: [opened]
pull_request:
types: [opened]
push:
branches: [main]
paths:
- ".github/workflows/auto-assign.yml"
jobs:
noop:
name: 💤 No-op
runs-on: ubuntu-latest
if: ${{ github.event_name != 'issues' && github.event_name != 'pull_request' }}
steps:
- run: echo "Auto-assign workflow only handles issues and pull requests."
auto-assign:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'issues' || github.event_name == 'pull_request' }}
steps:
- name: 👥 Auto-assign based on labels
uses: actions/github-script@v6
with:
script: |
const core = require('@actions/core');
const { context, github } = require('@actions/github');
// Auto-assignment rules based on labels
const assignmentRules = {
'bug': ['@maintainer1', '@qa-lead'],
'security': ['@security-team', '@maintainer1'],
'frontend': ['@frontend-team'],
'backend': ['@backend-team'],
'documentation': ['@docs-team'],
'sprint-planning': ['@product-owner', '@scrum-master']
};
const item = context.payload.issue || context.payload.pull_request;
if (!item) {
core.info('No issue or pull request payload detected; skipping auto-assign.');
return;
}
const labels = item.labels.map(label => label.name);
let assignees = new Set();
// Check each label and add corresponding assignees
labels.forEach(label => {
if (assignmentRules[label]) {
assignmentRules[label].forEach(assignee => {
assignees.add(assignee.replace('@', ''));
});
}
});
// Assign if we found any matching assignees
if (assignees.size > 0) {
const params = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: item.number,
assignees: Array.from(assignees)
};
if (context.payload.issue) {
await github.rest.issues.addAssignees(params);
} else {
await github.rest.pulls.requestReviewers({
...params,
pull_number: item.number,
reviewers: Array.from(assignees)
});
}
}
add-to-project:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'issues' || github.event_name == 'pull_request') && secrets.PROJECT_TOKEN != '' }}
steps:
- name: 📋 Add to Project Board
uses: actions/add-to-project@v0.4.0
with:
project-url: https://github.com/orgs/OWNER/projects/PROJECT_NUMBER
github-token: ${{ secrets.PROJECT_TOKEN }}
labeled: sprint-planning,bug,enhancement
label-operator: OR