Skip to content

Commit c2c2dcd

Browse files
authored
Add workflow for sending PRs to feature board (#18513)
Add workflow for sending PRs to feature board Co-authored-by: chiedo <chiedo@users.noreply.github.com>
1 parent 9f04cc0 commit c2c2dcd

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Send pull_request to How We Work Boards
2+
3+
# **What it does**: This sends pull requests with the feature label to the Docs Engineering feature board
4+
# **Why we have it**: If we use PRs to track features this automates them ending up on the feature board
5+
# **Who does it impact**: Docs Engineering team members
6+
7+
on:
8+
pull_request:
9+
types:
10+
- labeled
11+
- opened
12+
- reopened
13+
14+
jobs:
15+
triage:
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
steps:
19+
- if: (github.repository == 'github/docs-internal' || github.repository == 'github/docs') && (contains(github.event.pull_request.labels.*.name, 'engineering') && contains(github.event.pull_request.labels.*.name, 'feature'))
20+
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
21+
with:
22+
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
23+
script: |
24+
// Only do this for work by the engineering folks since multiple teams do work
25+
// in the docs repos
26+
try {
27+
await github.teams.getMembershipForUserInOrg({
28+
org: 'github',
29+
team_slug: 'docs-engineering',
30+
username: context.payload.sender.login,
31+
});
32+
} catch(err) {
33+
return
34+
}
35+
36+
var column_id = 13445681;
37+
try {
38+
github.projects.createCard({
39+
column_id: column_id,
40+
content_id: context.payload.pull_request.id,
41+
content_type: "PullRequest"
42+
});
43+
} catch (error) {
44+
console.log(error);
45+
}

0 commit comments

Comments
 (0)