{"id":51186118,"url":"https://github.com/taskcluster/tc-intake-board","last_synced_at":"2026-06-27T10:02:44.297Z","repository":{"id":357353449,"uuid":"1236515960","full_name":"taskcluster/tc-intake-board","owner":"taskcluster","description":"Some automation for TC Intake board - https://github.com/orgs/taskcluster/projects/23/views/1","archived":false,"fork":false,"pushed_at":"2026-05-12T11:03:13.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T13:07:49.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/taskcluster.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":null,"dco":null,"cla":null}},"created_at":"2026-05-12T10:15:24.000Z","updated_at":"2026-05-12T11:03:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/taskcluster/tc-intake-board","commit_stats":null,"previous_names":["taskcluster/tc-intake-board"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/taskcluster/tc-intake-board","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Ftc-intake-board","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Ftc-intake-board/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Ftc-intake-board/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Ftc-intake-board/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taskcluster","download_url":"https://codeload.github.com/taskcluster/tc-intake-board/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskcluster%2Ftc-intake-board/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34848932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-06-27T10:02:43.635Z","updated_at":"2026-06-27T10:02:44.282Z","avatar_url":"https://github.com/taskcluster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Date Sync\n\nAdds week-level reporting to a GitHub Projects v2 board by filling missing opened and completed week fields. It is designed to be idempotent and does not overwrite existing project values.\n\n## Setup\n\n1. Create or verify these Project v2 fields:\n   - Opened week: Text\n   - Completed week: Text\n\n   The legacy `Intake week` field name is still supported as the opened-week target.\n\n2. Create a token:\n   - Preferred production option: GitHub App installation token with project read/write permissions.\n   - Simpler prototype option: classic PAT with `project` scope.\n\n3. Add the repository secret:\n   - `PROJECTS_TOKEN`\n\n4. Run manually:\n   - Actions -\u003e Sync project dates -\u003e Run workflow\n   - Use `dry_run=true` first.\n\n5. Local development:\n\n   ```sh\n   gh auth refresh -s project\n   export ORG=taskcluster\n   export PROJECT_NUMBER=23\n   export GH_TOKEN=$(gh auth token)\n   DRY_RUN=true npm run sync\n   ```\n\nGitHub's documentation recommends a GitHub App for organization project automation, with a PAT as a simpler alternative for prototypes. See GitHub's docs for [automating Projects using Actions](https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions) and [using the API to manage Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects).\n\n## Behavior\n\n- Does not overwrite existing values.\n- Reads GitHub Projects' built-in `Created` field for opened-week values.\n- Reads GitHub Projects' built-in `Closed` field for completed-week values.\n- Falls back to issue or pull request `createdAt`/`closedAt` values if the built-in field value is absent.\n- Only updates text week fields.\n- Uses UTC dates.\n- Derives ISO week values as `YYYY-Www`.\n\n## PR lifecycle labeling\n\nFor **open pull requests**, the sync also computes a single PR-lifecycle label from observable\nGitHub state and writes it to an optional single-select project field.\n\nCreate this field on the board to enable it (the script validates but does not create fields):\n\n- `PR lifecycle`: Single select, with these options (names must match exactly):\n  - `pr-author-action-needed`\n  - `pr-blocked`\n  - `pr-ready-to-merge`\n  - `pr-review-pending`\n  - `pr-stale`\n  - `pr-draft-or-not-ready`\n\nIf the field is absent or not single-select, lifecycle labeling is skipped with a warning and the\ndate sync continues unaffected.\n\nExactly one label is assigned, chosen by the first matching rule in this priority order:\n\n`pr-author-action-needed` \u003e `pr-blocked` \u003e `pr-ready-to-merge` \u003e `pr-review-pending` \u003e `pr-stale` \u003e `pr-draft-or-not-ready`\n\n| Label | When |\n|---|---|\n| `pr-author-action-needed` | Changes requested, a failing **Taskcluster** check, or unresolved review threads. |\n| `pr-blocked` | Has a `blocked` label, or the body says `depends on #N` / `blocked by #N` / `blocked by:`. |\n| `pr-ready-to-merge` | Not draft, approved, mergeable, CI passing (or none configured), no unresolved threads. |\n| `pr-review-pending` | Not draft, with reviewers requested or review explicitly required. Also the default for an open non-draft PR with nothing else pending. |\n| `pr-stale` | No activity for 7+ days and not blocked (reachable only when no reviewers are assigned, since review-pending outranks stale). |\n| `pr-draft-or-not-ready` | Draft, or `WIP`/`draft:` in the title. |\n\nUnlike the week fields, the lifecycle label is **recomputed and overwritten every run** because it is\ndynamic. Issues and closed/merged PRs are left untouched.\n\n### CI signal (Taskcluster only)\n\nOnly **Taskcluster** checks count toward the CI part of the rules — other checks (GitHub Actions,\nCodecov, etc.) are ignored. A check is treated as Taskcluster when its status-context string,\ncheck-run name, or GitHub App slug matches a pattern (default `taskcluster|community-tc`,\ncase-insensitive). If a repo has no Taskcluster checks, CI is treated as non-blocking (it neither\nblocks merge nor triggers author-action).\n\nOverride the matcher with `TASKCLUSTER_CHECK_PATTERN` (a case-insensitive regex) if a deployment\nuses a different app slug or context name. To see what your PRs actually report, inspect a PR's\nchecks:\n\n```sh\ngh api graphql -f query='\nquery { repository(owner:\"taskcluster\", name:\"taskcluster\") { pullRequest(number: 8514) {\n  commits(last:1){nodes{commit{statusCheckRollup{contexts(first:100){nodes{\n    __typename ... on CheckRun{name checkSuite{app{slug}} conclusion}\n    ... on StatusContext{context state}}}}}}} } } }'\n```\n\n### Lifecycle limitations\n\n- `pr-blocked` is best-effort: only an explicit `blocked` label or `depends on`/`blocked by` markers\n  in the body are detected. External-team, infra-outage, or decision blockers are not observable and\n  will not be caught.\n- Only the first 50 review threads per PR are inspected for unresolved state.\n- Only the first 100 status checks on the latest commit are inspected; a Taskcluster failure beyond\n  the first 100 contexts could be missed on very large PRs.\n\n## Configuration\n\nEnvironment variables:\n\n```sh\nORG=taskcluster\nPROJECT_NUMBER=23\nGH_TOKEN=...\nDRY_RUN=false\nVERBOSE=false\nTASKCLUSTER_CHECK_PATTERN=taskcluster|community-tc\n```\n\n## Limitations\n\n- v1 does not create project fields.\n- v1 assumes project item `fieldValues` fit within the first 100 values.\n- v1 only fills `Completed week` when GitHub has a closed date.\n- v1 does not clear week fields when issues are reopened.\n\n## Troubleshooting\n\n- Missing token: set `GH_TOKEN` locally or configure the `PROJECTS_TOKEN` repository secret for Actions.\n- Invalid authorization header: recreate `PROJECTS_TOKEN` with the raw token value only. Do not include quotes, `Bearer`, `token`, a private key, JSON, or trailing newlines.\n- Missing project fields: create `Opened week` and `Completed week` as Text fields.\n- Token lacks project scope: refresh or replace the token with organization project read/write permissions.\n\n## Development\n\n```sh\nnpm test\nDRY_RUN=true npm run sync\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskcluster%2Ftc-intake-board","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaskcluster%2Ftc-intake-board","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskcluster%2Ftc-intake-board/lists"}