File tree Expand file tree Collapse file tree 7 files changed +47
-14
lines changed Expand file tree Collapse file tree 7 files changed +47
-14
lines changed Original file line number Diff line number Diff line change
1
+ ## DRI Schedule
2
+ | Week | Primary | Backup |
3
+ | ------ | -------- | ---------|
4
+ | 9/28 - 10/04 | @lorenpaulsen , @nosami | @cmbrose , @josegal |
5
+ | 10/5 - 10/11 | @cmbrose , @josegal | @bjbennet , @avodovnik |
6
+ | 10/12 - 10/19 | @bjbennet , @avodovnik | @rajkumar42 @drasticactions |
Original file line number Diff line number Diff line change
1
+ export interface IParsedIssue {
2
+ owner : string ;
3
+ repo : string ;
4
+ issueNumber : number ;
5
+ }
Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
2
import { env } from './utils/env'
3
3
4
- // add .env file support
4
+ // add .env file support for dev purposes
5
5
require ( 'dotenv' ) . config ( )
6
6
7
7
import { AuthorizationError } from './errors/AuthorizationError'
@@ -46,7 +46,7 @@ const renderProject = async (
46
46
)
47
47
const wrappedIssues = [ ...wrappedProgressIssues , ...wrappedDoneIssues ]
48
48
49
- const projectTitle = `### ${ project . name } `
49
+ const projectTitle = `## ${ project . name } `
50
50
const inWorkIssuesString = renderIssuesBlock (
51
51
`🏗️ In work (${ doneIssues . length } /${
52
52
progressIssues . length + doneIssues . length
@@ -93,7 +93,14 @@ async function run(): Promise<void> {
93
93
} )
94
94
)
95
95
96
- console . log ( result . join ( '\n' ) + '\n' ) ;
96
+ const issueBody = result . join ( '\n' ) + '\n' ;
97
+ const { status } = await projectKit . updateBoardIssue ( TEST_CONFIG . boardIssue , issueBody ) ;
98
+
99
+ if ( status !== 200 ) {
100
+ throw new Error ( `Failed to update the issue ${ TEST_CONFIG . boardIssue } .` ) ;
101
+ }
102
+
103
+ console . log ( `Successfully updated the board issue.` ) ;
97
104
}
98
105
} catch ( error ) {
99
106
console . error ( error ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { TProjectColumns } from '../interfaces/TProjectColumns';
6
6
import { TRepoIssue } from '../interfaces/TRepoIssue' ;
7
7
import { OctoKitBase } from './OctoKitBase' ;
8
8
import { TColumnTypes } from '../interfaces/TColumnTypes' ;
9
+ import { parseIssueUrl } from '../utils/parseIssueUrl' ;
9
10
10
11
type TColumnsMap = Record < TColumnTypes , TProjectColumn > ;
11
12
@@ -123,4 +124,15 @@ export class ProjectsOctoKit extends OctoKitBase {
123
124
124
125
return cardIssues ;
125
126
}
127
+
128
+ public updateBoardIssue = async ( issueUrl : string , body : string ) : Promise < any > => {
129
+ const { owner, repo, issueNumber } = parseIssueUrl ( issueUrl ) ;
130
+
131
+ return await this . kit . issues . update ( {
132
+ owner,
133
+ repo,
134
+ issue_number : issueNumber ,
135
+ body,
136
+ } ) ;
137
+ }
126
138
}
Original file line number Diff line number Diff line change
1
+ import { IParsedIssue } from '../interfaces/IParsedIssue' ;
2
+
3
+ export const parseIssueUrl = ( issueUrl : string ) : IParsedIssue => {
4
+ const uri = new URL ( issueUrl ) ;
5
+ const { pathname } = uri ;
6
+
7
+ const split = pathname . split ( '/' ) ;
8
+
9
+ return {
10
+ owner : split [ 1 ] ,
11
+ repo : split [ 2 ] ,
12
+ issueNumber : parseInt ( split [ 4 ] , 10 ) ,
13
+ } ;
14
+ } ;
Original file line number Diff line number Diff line change @@ -21,9 +21,7 @@ const renderIssuesList = (issues: IWrappedIssue[]) => {
21
21
22
22
export const renderIssuesBlock = ( title : string , issues : IWrappedIssue [ ] ) => {
23
23
return [
24
- '' ,
25
24
renderTitle ( title ) ,
26
- '' ,
27
25
renderIssuesList ( issues ) ,
28
26
] . join ( '\n' ) ;
29
27
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments