-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.23 KB
/
add-to-project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 }}