-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.41 KB
/
action-discover-projectboard.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Discover existing Project Boards
on:
workflow_dispatch:
inputs:
ownerProject:
description: "Do you want to discover Project Boards?"
default: "yes"
required: true
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: read
security-events: none
statuses: none
jobs:
discover-different-projects:
runs-on: ubuntu-latest
steps:
- name: Discover different Project Boards
uses: actions/github-script@v6
with:
github-token: ${{ secrets.CUSTOM_TOKEN }}
previews: 'inertia' # required for Projects API
script: |
try {
listProjects = await github.rest.projects.listForRepo({
owner: context.payload.organization.login ,
repo: context.payload.repository.name ,
per_page: 100
})
} catch(err) {
throw err
}
var count = 0
console.log("| Project Count | Project Name | Unique Project ID | Creator |")
listProjects.data.forEach(function(project) {
console.log("| Project " + count + " | " + project.name + " | " + project.id + " | " + project.creator.login + " |")
++ count
})