Automatically add an issue or pull request to specific GitHub Project when you create them. By default, the issues are assigned to the To do
column and the pull requests to the In progress
one, so make sure you have those columns in your project dashboard.
This action has been modified from the original action from masutaka. I needed to fix it as the original docker container would not build. Also I think the GitHub Action syntax changed a bit.
Required The url of the project to be assigned to.
Examples of action:
name: Auto Assign Project
on: [pull_request, issues]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
assign_one_project:
runs-on: ubuntu-latest
name: Assign to One Project
steps:
- name: Run assignment to one project
uses: srggrs/[email protected]
if: github.event.action == 'opened' # not required but speed up the action
with:
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'
Generate a token from the Organisation settings or User Settings and add it as a secret in the repository secrets as MY_GITHUB_TOKEN
name: Auto Assign Project
on: [pull_request, issues]
env:
MY_GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
jobs:
assign_one_project:
runs-on: ubuntu-latest
name: Assign to One Project
steps:
- name: Run assignment to one project
uses: srggrs/[email protected]
if: github.event.action == 'opened' # not required but speed up the action
with:
project: 'https://github.com/srggrs/assign-one-project-github-action/projects/2'