imjohnbo / issue-bot

GitHub Actions powered Issue Bot 🦾
https://github.com/imjohnbo/issue-bot
MIT License
101 stars 31 forks source link

Output Project V2 Issue Item ID #79

Closed parroty closed 2 years ago

parroty commented 2 years ago

Hi 👋. How do you think about adding an output parameter for "Project V2 Item ID", which will be returned by addProjectV2ItemById function call?

Background

Change

Example

Workflow

name: Open Issues (Sample)
on:
  workflow_dispatch:
env:
  PROJECT_NUMBER: 1
  ORGANIZATION: xxx
  REPOSITORY: yyy
jobs:
  create:
    name: Create issues
    runs-on: ubuntu-latest
    steps:
    - name: Get token
      id: get_workflow_token
      uses: peter-murray/workflow-application-token-action@v1
      with:
        application_id: ${{ secrets.APPLICATION_ID }}
        application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
    - name: Create new issue
      id: create-issue
      uses: parroty/issue-bot@with-item-id
      with:
        title: "Test Title"
        body: "Test Body"
        project-v2-path: "orgs/${{ env.ORGANIZATION }}/projects/${{ env.PROJECT_NUMBER }}"
        token: ${{ steps.get_workflow_token.outputs.token }}
    - uses: titoportas/update-project-fields@v0.1.0
      with:
        project-url: "https://github.com/orgs/${{ env.ORGANIZATION }}/projects/${{ env.PROJECT_NUMBER }}"
        github-token: ${{ steps.get_workflow_token.outputs.token }}
        item-id: ${{ steps.create-issue.outputs.project-v2-issue-item-id }}
        field-keys: "Status,Component,Size"
        field-values: "Todo,Frontend,5"

Action Logs (Exerpt)

Run parroty/issue-bot@with-item-id
...

Adding issue with node ID I_kwDXIIG0F85Ta8sL to project V2 URL: orgs/xxx/projects/1
Adding issue with node ID I_kwDXIIG0F85Ta8sL to project V2 with node ID: PVT_kwXOBg-OtM4AGxgx
New issue number: 35

Previous issue number: -1

Project V2 Issue Item Id: PVTI_lAXOBg-OtM4AGxgxzgC0P1Q