Skip to content

Replace built-in auto-add workflows with GitHub Actions #7

@knoan

Description

@knoan

Problem

Built-in "Auto-add to project" workflows are scoped to a single repository each, with a cap of 5 on Pro/Team
plans. There is no way to target multiple repos in one workflow.

Solution

Replace built-in workflows with actions/add-to-project, hosted as a
reusable workflow in the metreeca/.github repository.

Central workflow

Define .github/workflows/project-add.yml in metreeca/.github:

name: Add to project
on:
  issues:
    types: [opened]
  pull_request:
    types: [opened]

jobs:
  add-to-project:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@v1
        with:
          project-url: https://github.com/orgs/metreeca/projects/3
          github-token: ${{ secrets.PROJECT_TOKEN }}

Per-repo caller

Each repo calls the central workflow with a one-liner:

name: Add to project
on:
  issues: { types: [opened] }
  pull_request: { types: [opened] }
jobs:
  add:
    uses: metreeca/.github/.github/workflows/project-add.yml@main
    secrets: inherit

Alternatively, since metreeca/.github is public, org-wide workflow inheritance may apply without per-repo callers.

Token setup

  1. Create a fine-grained PAT with:
    • Organisation projects: read and write
    • Repository Issues: read
    • Pull requests: read
  2. Add it as an org secret named PROJECT_TOKEN (Settings → Secrets → Actions)

Comparison

Built-in Actions-based
Repo limit 5 (Pro/Team) Unlimited
Filter flexibility Limited Full event context, custom logic
Custom logic None Can set status, labels, custom fields
Audit trail None Full workflow run logs

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions