File tree 3 files changed +8
-9
lines changed
3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
- const { Octokit } = require ( '@octokit/action' ) ;
2
-
3
- const octokit = new Octokit ( ) ;
4
-
5
1
( async ( ) => {
2
+ const { Octokit } = await import ( '@octokit/action' ) ;
3
+ const octokit = new Octokit ( ) ;
4
+
6
5
try {
7
6
await octokit . request (
8
7
`POST /repos/cfu288/ansible_inventories/actions/workflows/${ process . env . WORKFLOW_ID } /dispatches` ,
9
8
{
10
9
ref : 'main' ,
11
- }
10
+ } ,
12
11
) ;
13
- console . log ( 'Stage deploy completed' ) ;
12
+ console . log ( 'Deploy completed' ) ;
14
13
} catch ( error ) {
15
- console . log ( 'Error when attempting to trigger stage deploy:' , error ) ;
14
+ console . log ( 'Error when attempting to trigger deploy:' , error ) ;
16
15
process . exit ( 1 ) ;
17
16
}
18
17
} ) ( ) ;
Original file line number Diff line number Diff line change 72
72
with :
73
73
node-version : 18
74
74
- run : npm install @octokit/action
75
- - run : node .github/actions/trigger-stage -deploy.js
75
+ - run : node .github/actions/trigger-env -deploy.js
76
76
env :
77
77
GITHUB_TOKEN : ${{ secrets.PAT_DEPLOY_GITHUB_TOKEN }}
78
78
WORKFLOW_ID : ${{ vars.PROD_WORKFLOW_ID }}
Original file line number Diff line number Diff line change 46
46
with :
47
47
node-version : 18
48
48
- run : npm install @octokit/action
49
- - run : node .github/actions/trigger-stage -deploy.js
49
+ - run : node .github/actions/trigger-env -deploy.js
50
50
env :
51
51
GITHUB_TOKEN : ${{ secrets.PAT_DEPLOY_GITHUB_TOKEN }}
52
52
WORKFLOW_ID : ${{ vars.STAGE_WORKFLOW_ID }}
You can’t perform that action at this time.
0 commit comments