{"id":29005307,"url":"https://github.com/vst/gh-cpi","last_synced_at":"2026-04-22T21:37:16.940Z","repository":{"id":280098179,"uuid":"940972439","full_name":"vst/gh-cpi","owner":"vst","description":"Create GitHub Issue, Add to GitHub Project (v2)","archived":false,"fork":false,"pushed_at":"2025-10-07T06:02:46.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T08:19:27.477Z","etag":null,"topics":["cli","github","github-projects"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-01T07:05:13.000Z","updated_at":"2025-10-07T06:02:40.000Z","dependencies_parsed_at":"2025-06-22T16:23:55.112Z","dependency_job_id":"85e9d264-5e54-482b-bd93-d710cece7cb2","html_url":"https://github.com/vst/gh-cpi","commit_stats":null,"previous_names":["vst/gh-cpi"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vst/gh-cpi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fgh-cpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fgh-cpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fgh-cpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fgh-cpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vst","download_url":"https://codeload.github.com/vst/gh-cpi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fgh-cpi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32156604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"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":["cli","github","github-projects"],"created_at":"2025-06-25T11:05:47.561Z","updated_at":"2026-04-22T21:37:16.930Z","avatar_url":"https://github.com/vst.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-cpi - Create GitHub Project Issue\n\nThis program creates a GitHub issue, adds it to a GitHub project and sets\nproject fields.\n\n## Motivation\n\nThere are a few GitHub Actions which can create issues and/or add them to\na project (v2), but none of them can set project fields. Unfortunately, GitHub\nAPIs (both REST and GraphQL) and `gh` CLI does not provide a convenient way to\nset project fields due to that they work with IDs instead of values and the\ninput structure is discriminated over field types.\n\nThis tool works out the inconvenience/limitations by issuing queries to find\nfield IDs and map field values to field value IDs (for select options or\niterations), and then set field values with these IDs.\n\nAs a result, you can use the tool on an ad-hoc basis for a given set of Markdown\nfiles on your workstation, or use it on a GitHub Action.\n\n## Installation and Usage\n\nIf you are a Nix user and have `flakes` enabled, you can install the tool with:\n\n```sh\nnix profile install github:vst/gh-cpi\n```\n\n... or directly run it with:\n\n```sh\nnix run github:vst/gh-cpi\n```\n\n- You can provide the GitHub API token with the `GH_TOKEN` environment variable\n  or with the `--token` command line option.\n- You can provide the Markdown file with the `GH_CPI_ISSUE_FILE` environment\n  variable or with the `--file` command line option.\n\nFinally, if you have a PAT or Classic Token that has appropriate permissions,\nyou can use the tool in a GitHub Action. Here is an example:\n\n```yaml\non:\n  schedule:\n    - cron: \"15 6 1 * *\"\n\n  workflow_dispatch:\n\nname: \"Create Monthly Issues\"\n\npermissions:\n  contents: \"read\"\n  issues: \"write\"\n\njobs:\n  create:\n    runs-on: \"ubuntu-latest\"\n    steps:\n      - name: \"Checkout Codebase\"\n        uses: \"actions/checkout@v4\"\n\n      - name: \"Install Nix\"\n        uses: \"DeterminateSystems/nix-installer-action@v16\"\n\n      - name: \"Install gh-cpi\"\n        run: \"nix profile install github:vst/gh-cpi\"\n\n      - name: \"Create Issue: Monthly Security Checks\"\n        run: \"gh-cpi\"\n        env:\n          GH_TOKEN: \"${{ secrets.CPI_GH_TOKEN }}\"\n          GH_CPI_ISSUE_FILE: \"./issues/monthly-security-checks.md\"\n\n      - name: \"Create Issue: Monthly Cloud Costs Review\"\n        run: \"gh-cpi\"\n        env:\n          GH_TOKEN: \"${{ secrets.CPI_GH_TOKEN }}\"\n          GH_CPI_ISSUE_FILE: \"./issues/monthly-cloud-costs-review.md\"\n```\n\n## Markdown File\n\nThe input is a GitHub API token and a Markdown file with a front matter.\nA sample Markdown file is:\n\n```markdown\n---\ntitle: \"My Issue Title\"\nowner: \"my-organization-or-user\"\nrepository: \"my-repo\"\nproject: 1\nassignees:\n  - \"my-assignee\"\nlabels:\n  - \"label-a\"\n  - \"label-b\"\nstatus: \"Planned\"\niteration: \"@next\"\nsize: \"medium\"\ndifficulty: \"easy\"\ninception: \"2022-06-06\"\n---\n\nIssue body text in Markdown format.\n```\n\n\u003e [!CAUTION]\n\u003e\n\u003e This tool assumes a very particular GitHub project setup.\n\u003e\n\u003e I am planning to make this more generic in the future. If you have interest,\n\u003e please star the repository and open an issue.\n\n- All front matter fields are required.\n- The `project` field is the project number.\n- `title` field can contain Python string formatting placeholders. Available\n  substitions are:\n  - `{current_iteration}` such as `143`\n  - `{next_iteration}` such as `144`\n  - `{now}` such as `2025-01-02T12:00:00Z`\n  - `{today}` such as `2025-01-02`\n  - `{tomorrow}` such as `2025-01-03`\n  - `{this_week}` such as `2025/w01`\n  - `{next_week}` such as `2025/w02`\n  - `{this_month}` such as `2025-01`\n  - `{next_month}` such as `2025-02`\n- If you want to escape the placeholders, use double braces, such as `{{today}}`.\n- The project setup is a very particular one:\n  - `status` refers to a `SingleSelect` field with name `Status` and with\n    following options:\n    - `Inbox`\n    - `Triage`\n    - `Backlog`\n    - `Planned`\n    - `Active`\n    - `Done`\n  - `iteration` refers to a `Iteration` field with name `Iteration` with\n    weekly iterations starting from `inception` onwards. It can be either\n    `@current` or `@next`.\n  - `size` refers to a `SingleSelect` field with name `Size` with following options:\n    - `small`\n    - `medium`\n    - `large`\n  - `difficulty` refers to a `SingleSelect` field with name `Difficulty` with\n    following options:\n    - `easy`\n    - `medium`\n    - `hard`\n- You can pass `type` as the issue type as long as:\n  - The owner is an organization, and\n  - `type` is one of:\n    - `Task`\n    - `Bug`\n    - `Feature`\n    - `Epic`\n    - `Docs`\n\n## Development\n\nEnter the Nix shell:\n\n```sh\nnix develop\n```\n\nRun the tests:\n\n```sh\nblack --check gh-cpi.py\nisort --check gh-cpi.py\nflake8 gh-cpi.py\nmypy gh-cpi.py\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE)\nfile.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvst%2Fgh-cpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvst%2Fgh-cpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvst%2Fgh-cpi/lists"}