srggrs / assign-one-project-github-action

Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
MIT License
169 stars 60 forks source link

Support for just the project_number #71

Open woodie opened 3 years ago

woodie commented 3 years ago

We should have $GITHUB_SERVER_URL and $GITHUB_REPOSITORY in the environment. Any chance we can make this more portable by accepting a project number?

jobs:
  add-new-issues:
    runs-on: ubuntu-latest
    steps:
      - uses: srggrs/assign-one-project-github-action@1.2.1
        with:
          project_number: 1
woodie commented 3 years ago

Actually, this works just fine as well.

name: Add new issues to project board

on:
  issues:
    types: [opened]

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  add-new-issues:
    runs-on: ubuntu-latest
    steps:
      - uses: srggrs/assign-one-project-github-action@1.2.1
        with:
          project: 'https://github.com/${{ github.repository }}/projects/1'