File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1010
1111 if ( GITHUB_REF === 'refs/heads/master' ) {
1212 _updateNotionStatuses ( 'master' )
13+ } else if ( GITHUB_REF === 'refs/heads/main' ) {
14+ _updateNotionStatuses ( 'main' )
1315 } else if ( GITHUB_REF === 'refs/heads/staging' ) {
1416 _updateNotionStatuses ( 'staging' )
1517 } else if ( GITHUB_REF === 'refs/heads/dev' ) {
@@ -46,7 +48,6 @@ async function _updateNotionStatuses (branch) {
4648 } )
4749
4850 const repositoryName = GITHUB_REPOSITORY . split ( '/' ) . pop ( )
49- console . log ( repositoryName )
5051
5152 // Get most recent commit to branch
5253 const { data } = await octokit . rest . repos . getCommit ( {
@@ -65,9 +66,14 @@ async function _updateNotionStatuses (branch) {
6566
6667 switch ( branch ) {
6768 case 'master' :
69+ case 'main' :
6870 if ( commitMessage . includes ( 'from coursedog/staging' ) ) {
6971 // Update all tasks that are in Completed Staging to Completed Prod
7072 notionUtil . updateByStatus ( 'Completed (Staging)' , 'Completed (Production)' )
73+ } else if ( commitMessage . match ( / # + [ 0 - 9 ] / ) ) {
74+ // direct from open PR to staging
75+ const prNumber = commitMessage . split ( '#' ) [ 1 ] . replace ( / \D / g, '' )
76+ notionUtil . updateByPR ( `${ repositoryName } /pull/${ prNumber } ` , 'Completed (Production)' )
7177 }
7278 break
7379 case 'staging' :
You can’t perform that action at this time.
0 commit comments