https://github.com/babbel/assign-to-repository-projects
Github Action asigning pull requests to GitHub projects of a repository
https://github.com/babbel/assign-to-repository-projects
actions
Last synced: about 2 months ago
JSON representation
Github Action asigning pull requests to GitHub projects of a repository
- Host: GitHub
- URL: https://github.com/babbel/assign-to-repository-projects
- Owner: babbel
- License: mit
- Created: 2023-05-05T11:59:41.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-04-14T10:52:18.000Z (2 months ago)
- Last Synced: 2026-04-14T12:16:55.040Z (2 months ago)
- Topics: actions
- Language: JavaScript
- Homepage:
- Size: 2.97 MB
- Stars: 1
- Watchers: 20
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# assign-to-repository-projects
Github Action assigning pull requests to GitHub projects of a repository.
## Context
This GitHub Action assigns a pull request to [GitHub projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) (aka Projects V2). The intended use case is, that a PR given by `pull_request` type GitHub action event should be assigned to one or more projects. The projects are give by a list of project titles. For each title, the PR is assigned to the matching project. After that the resulting project item's `Status` field value is set to `Todo`, additionally. (The field `Status` and the single select option `Todo` are created by default with any project by API and are assumed to exist.) The action is idempotent for GitHub projects given the same inputs.
## Requirements
This GitHub action expects an GitHub action event of type [push](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push).
Moreover, the GitHub token of a GitHub App installation is expected as environment variable `GITHUB_TOKEN`. The GitHub App requires the following permissions.
- Read access to administration and metadata
- Read and write access to code, organization projects and pull requests
## Inputs
| Name | Description | Type | Required? |
|------------------|-------------------------------------------------------------------------------------------------|--------------|-----------|
| `project-titles` | Space-separated list of titles of projects linked to this repository the PR will be assigned to | `string` | YES |
## Outputs
| Name | Description | Type |
|------------------|-------------------------------------------------------------------------------------------|---------|
| `project-titles` | Space-separated list of titles of projects in this repository the PR has been assigned to | `string`|
## Build process
Instead of checking in `node_modules` for the [JavaScript action](https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action)
we are using [ncc](https://github.com/vercel/ncc). To build the project run `npm run build`.
## Tests
This project is using [Jest](https://jestjs.io/) for testing. Combining Jest and ES modules [requires](https://jestjs.io/docs/ecmascript-modules) setting node flag `--experimental-vm-modules`. Run the tests as follows.
```
NODE_OPTIONS='--experimental-vm-modules' npm run test
```