{"id":16123568,"url":"https://github.com/austenstone/project-update","last_synced_at":"2025-03-18T12:31:23.740Z","repository":{"id":42503676,"uuid":"471229785","full_name":"austenstone/project-update","owner":"austenstone","description":"Update item fields for projects (beta)","archived":false,"fork":false,"pushed_at":"2023-01-08T02:06:28.000Z","size":610,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T15:40:59.737Z","etag":null,"topics":["actions","projects"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/austenstone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2022-03-18T03:59:37.000Z","updated_at":"2025-02-15T23:34:49.000Z","dependencies_parsed_at":"2023-01-11T17:22:12.907Z","dependency_job_id":null,"html_url":"https://github.com/austenstone/project-update","commit_stats":{"total_commits":54,"total_committers":2,"mean_commits":27.0,"dds":0.01851851851851849,"last_synced_commit":"cf365cea00f7f81efd34d48055e86187c9aba013"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fproject-update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fproject-update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fproject-update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austenstone%2Fproject-update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austenstone","download_url":"https://codeload.github.com/austenstone/project-update/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926046,"owners_count":20369911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actions","projects"],"created_at":"2024-10-09T21:17:27.709Z","updated_at":"2025-03-18T12:31:23.314Z","avatar_url":"https://github.com/austenstone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Update Item Field Projects (BETA) ✏️\n\nThis GitHub [action](https://docs.github.com/en/actions) updates item fields on [Projects (beta)](https://github.com/features/issues).\n\nThe action is great to use in combination with [project-add](https://github.com/austenstone/project-add) as you will need to obtain the `item-id` to update an item's field.\n\n#### Field Type Support\n- Text\n- Number\n- Date\n- Single select\n- Iteration\n\n`field-names` are supplied as a CSV list of names.\n```yml\n          field-names: Status,Iteration,product,priority\n```\n`field-values` are supplied as a CSV list of corresponding values. \n\n```yml\n          field-values: todo,[0],back-end,high\n```\nOptions and iterations are matched by the name(case-insensitive). You can also use an array index notation. For example `[0]` would be the first option or iteration. The first iteration is always the current one.\n\n## Usage\nCreate a workflow (eg: `.github/workflows/on-issue-pr-open.yml`). See [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).\n\nYou will need a project number for input `project-number`. For example [`https://github.com/users/austenstone/projects/`*`5`*](https://github.com/users/austenstone/projects/5) the project number is *`5`*.\n\nYou will need to [create a PAT(Personal Access Token)](https://github.com/settings/tokens/new?scopes=admin:org) that has `admin:org` access so we can read/write to the project.\n\nAdd this PAT as a secret so we can use it as input `github-token`, see [Creating encrypted secrets for a repository](https://docs.github.com/en/enterprise-cloud@latest/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository).\n\n### Organizations\n\nIf your project is part of an organization that has SAML enabled you must authorize the PAT, see [Authorizing a personal access token for use with SAML single sign-on](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).\n\n#### Example: Add Issues and PRs\n```yml\nname: \"Add Issue/PR to Project\"\non:\n  issues:\n    types: [opened]\n  pull_request:\n    types: [opened]\n\njobs:\n  add_to_project:\n    name: Add to Project\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: austenstone/project-add@main\n        with:\n          user: ${{ github.repository_owner }}\n          project-number: 5\n          github-token: \"${{ secrets.MY_TOKEN }}\"\n        id: project-add\n      - uses: austenstone/project-update@main\n        with:\n          user: ${{ github.repository_owner }}\n          project-number: 5\n          github-token: \"${{ secrets.MY_TOKEN }}\"\n          item-id: ${{ steps.project-add.outputs.id }}\n          field-names: product,priority\n          field-values: back-end,high\n```\n\n### Users\n\nFor user owned projects you must provide the `user` input in the workflow.\n\n```yml\n        with:\n          user: ${{ github.repository_owner }}\n          github-token: \"${{ secrets.MY_TOKEN }}\"\n          project-number: 1234\n```\n\n## Input Settings\nVarious inputs are defined in [`action.yml`](action.yml):\n\n| Name | Description | Default |\n| --- | - | - |\n| **project-number** | The project number. Get this from the URL. | N/A |\n| github-token | Token to use to authorize. This should be a personal access token. | ${{\u0026nbsp;github.token\u0026nbsp;}} |\n| organization | The organization that owns of the project. | _the repository owner_\n| user | The user that owns of the project. | N/A\n| **item-id** | The item Id of the issue or pull request. | N/A |\n| field-names | CSV fields to modify. | N/A\n| field-values | CSV fields values. | N/A\n\nIf you are using a user owned project board you must provide the `user` input.\u003cbr\u003e`${{ github.repository_owner }}` is fine if you're the owner of the repository.\n\n## Permissions\nUntil GitHub supports permissions for projects (beta) we will need to [create a PAT(Personal Access Token)](https://github.com/settings/tokens/new?scopes=admin:org) with `admin:org` scope.\n\nOnce support is added you we can utilize [Assigning permissions to jobs](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) and the action will default to the token `${{ github.token }}`.\n\n```yml\npermissions:\n  repository-projects: write\n```\n\nAnother option is to use something like [tibdex/github-app-token](https://github.com/tibdex/github-app-token) to get a token during the workflow.\n\n## References\n- [Automating projects (beta)](https://docs.github.com/en/enterprise-cloud@latest/issues/trying-out-the-new-projects-experience/automating-projects)\n- [Example workflow authenticating with a GitHub App](https://docs.github.com/en/enterprise-cloud@latest/issues/trying-out-the-new-projects-experience/automating-projects#example-workflow-authenticating-with-a-github-app)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustenstone%2Fproject-update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustenstone%2Fproject-update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustenstone%2Fproject-update/lists"}