Skip to content

test: Test hugrverse-actions add-to-project automation #2

test: Test hugrverse-actions add-to-project automation

test: Test hugrverse-actions add-to-project automation #2

name: Add issues to project board
on:
# Allow this workflow to be called by another workflow
workflow_call:
inputs:
project-url:
description: 'The URL of the project board to add the issue to'
required: true
type: string
secrets:
GITHUB_PAT:
description: 'The github token with permissions to add issues to the project'
required: true
# The caller should use these triggers on their workflow file
issues:
types:
- opened
jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
env:
# We use this workflow locally for hugrverse-actions issues.
# This variable detects whether we are running the workflow locally or via an external workflow_call.
#
# Github's terrible version of a 'ternary operator'
# https://github.com/actions/runner/issues/409#issuecomment-752775072
PROJECT_URL: ${{ github.repository == env.REPOSITORY && 'https://github.com/orgs/CQCL-DEV/projects/10' || github.event.inputs.project-url }}
with:
project-url: ${{ env.PROJECT_URL }}
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}