{"id":47681387,"url":"https://github.com/coloredcow/github-project-automation","last_synced_at":"2026-04-02T14:00:50.616Z","repository":{"id":337434603,"uuid":"1153455824","full_name":"ColoredCow/github-project-automation","owner":"ColoredCow","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-21T09:20:07.000Z","size":286,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-21T13:14:33.950Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColoredCow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-09T10:17:41.000Z","updated_at":"2026-02-21T09:20:11.000Z","dependencies_parsed_at":"2026-02-21T13:14:36.766Z","dependency_job_id":null,"html_url":"https://github.com/ColoredCow/github-project-automation","commit_stats":null,"previous_names":["satendra-sr/github-project-automation","coloredcow/github-project-automation"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ColoredCow/github-project-automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColoredCow%2Fgithub-project-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColoredCow%2Fgithub-project-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColoredCow%2Fgithub-project-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColoredCow%2Fgithub-project-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColoredCow","download_url":"https://codeload.github.com/ColoredCow/github-project-automation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColoredCow%2Fgithub-project-automation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-02T14:00:26.056Z","updated_at":"2026-04-02T14:00:50.605Z","avatar_url":"https://github.com/ColoredCow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Project Automation\n\nReusable GitHub Action to automate cross-repo PR + Issue + Projects V2 workflows. This repo is set up for Sneha first, but the action is configurable for other repo pairs through `.github/automation.yml`.\n\n## Features (Phase 1)\n- On PR `review_requested` or `ready_for_review`\n  - Add label `Ready For Review` to the PR (if missing)\n  - Parse `Targets: coloredcow-admin/sneha-lms#\u003cissue_id\u003e` from PR body\n  - Move Issue to `In review` in Project V2 `SNEHA LMS`\n  - Audit comments on the Issue for changes that occurred\n- On PR review `submitted` with state `approved` or `changes_requested`\n  - Remove any configured ready-for-review label from the PR\n  - Add reviewed label `status : reviewed` (if missing)\n- On PR `opened` or `synchronize`\n  - Optionally self-assign the targeted issue to the PR author (without removing existing assignees)\n  - Move Issue to `In Progress` if not already at/after `In review`\n  - Audit comments only if status changed\n- If Issue is not in the Project, add it first\n- No spam: comments are only posted when an actual change occurred\n- If a matched rule needs issue/project actions and Targets is missing/invalid, comment on the PR and exit\n\n## Usage\n\n## Prerequisites\n- A pull request template that includes a Targets line:\n  - `Targets: owner/repo#\u003cissue_id\u003e` (cross-repo)\n  - `Targets: #\u003cissue_id\u003e` (same-repo)\n- A GitHub Project V2 with a single-select Status field and options matching your config.\n- Repository files:\n  - `.github/automation.yml`\n  - `.github/workflows/pr_automation.yml`\n\n## Setup (Consuming Repo)\n1. Create a **classic PAT** (recommended, works reliably with Projects V2):\n   - Settings -\u003e Developer settings -\u003e Personal access tokens -\u003e Tokens (classic)\n   - Scopes:\n     - `repo`\n     - `read:project`\n     - `write:project`\n   Note: We tried fine-grained PATs, but Projects permissions are not always available there. Classic PATs work consistently for Projects V2.\n2. Add the token as a secret in the PR repo:\n   - Secret name: `GH_AUTOMATION_TOKEN`\n3. Add `.github/automation.yml` and `.github/workflows/pr_automation.yml` (examples below).\n\n### Workflow example (coloredcow-admin/sneha)\n```yaml\nname: PR Automation\n\non:\n  pull_request:\n    types: [opened, synchronize, ready_for_review, review_requested]\n  pull_request_review:\n    types: [submitted]\n\npermissions:\n  contents: read\n  pull-requests: write\n  issues: write\n\njobs:\n  pr-automation:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - name: Run automation\n        uses: ColoredCow/github-project-automation@v1\n        with:\n          token: ${{ secrets.GH_AUTOMATION_TOKEN }}\n          config-path: .github/automation.yml\n```\n\n### Config schema\nCreate `.github/automation.yml` in the consuming repo:\n```yaml\nissue_repo:\n  owner: coloredcow-admin\n  name: sneha-lms\nproject:\n  owner: coloredcow-admin\n  name: SNEHA LMS\n  status_field: Status\n  status_order:\n    - Backlog\n    - Ready\n    - On Hold\n    - In Progress\n    - In review\n    - QA\n    - Completed\nlabels:\n  ready_for_review: Ready For Review\n  ready_for_review_any:\n    - Ready For Review\n    - \"status: ready for review\"\n  reviewed: \"status : reviewed\"\n  reviewed_any:\n    - \"status : reviewed\"\n    - Reviewed\nrules:\n  - on:\n      event: pull_request\n      actions: [opened]\n    do:\n      - assign_issue_to_pr_author: true\n  - on:\n      event: pull_request\n      actions: [opened, synchronize]\n    do:\n      - ensure_issue_in_project: true\n      - ensure_status_at_least: In Progress\n      - audit_on_change: true\n  - on:\n      event: pull_request\n      actions: [review_requested, ready_for_review]\n    do:\n      - add_pr_label_if_missing: Ready For Review\n      - ensure_issue_in_project: true\n      - ensure_status_at_least: In review\n      - audit_on_change: true\n  - on:\n      event: pull_request_review\n      actions: [submitted]\n    do:\n      - remove_pr_labels_if_present:\n          - Ready For Review\n          - \"status: ready for review\"\n      - add_pr_label_if_missing: \"status : reviewed\"\n```\n\n`assign_issue_to_pr_author` adds the PR author to the issue assignees list only if not already assigned. Existing assignees are preserved.\n\n## Inputs\n- `token` (required): Token with cross-repo + Projects V2 permissions\n- `config-path` (optional): Defaults to `.github/automation.yml`\n- `dry-run` (optional): Defaults to `false` and skips writes when true\n\n## Outputs\n- `did_label_change`\n- `did_status_change`\n- `issue_number` (set only when issue/project/audit behavior is executed)\n- `target_status`\n\n## Targets line format\nRequired when matched rules include issue/project/audit behavior:\n```\nTargets: coloredcow-admin/sneha-lms#123\n```\nThis format is intentionally strict. The action will only accept a `Targets` line that matches the repo configured under `issue_repo` in `.github/automation.yml`. This keeps cross-repo automation explicit and safe.\nSupported whitespace variants:\n- `Targets:coloredcow-admin/sneha-lms#123`\n- `Targets: coloredcow-admin/sneha-lms #123`\nFor same-repo cases, a short format is also accepted:\n- `Targets: #123`\n\nIf missing or invalid for those rules, the action comments on the PR and exits.\n\n## Permissions / Token scopes\n`GITHUB_TOKEN` often lacks cross-repo + Projects V2 permissions. Use a secret token input named `GH_AUTOMATION_TOKEN`.\n\n### PAT classic\nRequired scopes:\n- `repo` (read/write issues + PRs)\n- `read:project` and `write:project` (Projects V2)\n\n### Fine-grained PAT\nGrant access to both repos and:\n- Issues: Read \u0026 write on `coloredcow-admin/sneha-lms`\n- Pull requests: Read \u0026 write on `coloredcow-admin/sneha`\n- Projects: Read \u0026 write (organization-level Projects V2)\n\n### GitHub App\nGrant installation to both repos and add:\n- Issues: write\n- Pull requests: write\n- Projects: read/write\n\n## Build and bundle\nThis action is bundled via `esbuild` (CJS output) and committed to `dist/index.js`.\nRuntime: Node.js 24 (set in `action.yml`).\n\n```bash\nnpm run build\nnpm run bundle\n```\n\n## Troubleshooting\n- **Project not found**: Ensure `project.owner` and `project.name` match exactly, or set `project.number`.\n- **Status option mismatch**: Ensure `status_order` entries exactly match the Project Status options.\n- **Missing Targets**: Add `Targets: coloredcow-admin/sneha-lms#\u003cissue_id\u003e` to the PR body.\n- **Permissions errors**: Use a token with cross-repo issue/PR write and Projects V2 read/write scopes.\n\n## Example consuming repo files\nSee `examples/coloredcow-admin-sneha/.github/workflows/pr_automation.yml` and `examples/coloredcow-admin-sneha/.github/automation.yml`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoloredcow%2Fgithub-project-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoloredcow%2Fgithub-project-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoloredcow%2Fgithub-project-automation/lists"}