diff --git a/.github/workflows/auto-label-issues.yml b/.github/workflows/auto-label-issues.yml new file mode 100644 index 00000000..9716282e --- /dev/null +++ b/.github/workflows/auto-label-issues.yml @@ -0,0 +1,34 @@ +name: Auto-Label Issues +on: + issues: + types: [opened] + +jobs: + auto-label: + runs-on: ubuntu-latest + steps: + - name: Label based on title + uses: actions/github-script@v7 + with: + script: | + const title = context.payload.issue.title.toLowerCase(); + const labels = []; + + if (title.includes('bug') || title.includes('fix') || title.includes('crash')) { + labels.push('bug'); + } else if (title.includes('feat') || title.includes('add') || title.includes('implement')) { + labels.push('enhancement'); + } else if (title.includes('docs') || title.includes('documentation')) { + labels.push('documentation'); + } else if (title.includes('test') || title.includes('testing')) { + labels.push('testing'); + } + + if (labels.length > 0) { + github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: labels + }); + } diff --git a/.github/workflows/epic-subtask-sync.yml b/.github/workflows/epic-subtask-sync.yml new file mode 100644 index 00000000..815d446e --- /dev/null +++ b/.github/workflows/epic-subtask-sync.yml @@ -0,0 +1,29 @@ +name: Epic Sub-task Sync +on: + issues: + types: [closed, reopened] + +jobs: + sync-epic-progress: + runs-on: ubuntu-latest + if: contains(github.event.issue.body, 'Part of #412') || contains(github.event.issue.body, 'Parent Epic') + steps: + - name: Update epic status + uses: actions/github-script@v7 + with: + script: | + // Find parent epic from issue body + const body = context.payload.issue.body; + const epicMatch = body.match(/#(\d+)/); + if (epicMatch) { + const epicNumber = epicMatch[1]; + + // Comment on epic about sub-task status change + const status = context.payload.action === 'closed' ? 'completed' : 'reopened'; + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: epicNumber, + body: `📊 Sub-task #${context.issue.number} has been **${status}**` + }); + } diff --git a/.github/workflows/project-auto-progress.yml b/.github/workflows/project-auto-progress.yml new file mode 100644 index 00000000..e68fbfb9 --- /dev/null +++ b/.github/workflows/project-auto-progress.yml @@ -0,0 +1,34 @@ +name: Project Auto-Progress +on: + issues: + types: [assigned, reopened] + pull_request: + types: [opened] + branches: [main, develop] + +jobs: + update-project-status: + runs-on: ubuntu-latest + steps: + - name: Move to In Progress on assignment + if: github.event_name == 'issues' && github.event.action == 'assigned' + uses: actions/github-script@v7 + with: + script: | + const projectId = 'PVT_kwDOAnuWxs4BRcst'; + const statusFieldId = 'PVTSSF_lADOAnuWxs4BRcstzg_RgWc'; + const inProgressOptionId = '47fc9ee4'; + + // Update issue status in project + await github.graphql(` + mutation { + updateProjectV2ItemFieldValue: updateProjectV2ItemFieldValue( + input: { + projectId: "${projectId}" + itemId: "${{ github.event.issue.node_id }}" + fieldId: "${statusFieldId}" + value: { singleSelectOptionId: "${inProgressOptionId}" } + } + ) { clientMutationId } + } + `); diff --git a/.github/workflows/stale-issue-management.yml b/.github/workflows/stale-issue-management.yml new file mode 100644 index 00000000..48c648a8 --- /dev/null +++ b/.github/workflows/stale-issue-management.yml @@ -0,0 +1,20 @@ +name: Stale Issue Management +on: + schedule: + - cron: '0 0 * * 1' # Weekly on Monday + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has been inactive for 30 days. Please update or it will be closed in 7 days.' + stale-pr-message: 'This PR has been inactive for 30 days. Please update or it will be closed in 7 days.' + close-issue-message: 'Closing due to inactivity. Reopen if still needed.' + days-before-stale: 30 + days-before-close: 7 + exempt-issue-labels: 'epic,in-progress,priority-high' + exempt-pr-labels: 'in-review'