Skip to content

Commit 0e1e4b8

Browse files
committed
build: update ga workflows
1 parent 026d79a commit 0e1e4b8

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
const { Octokit } = require('@octokit/action');
2-
3-
const octokit = new Octokit();
4-
51
(async () => {
2+
const { Octokit } = await import('@octokit/action');
3+
const octokit = new Octokit();
4+
65
try {
76
await octokit.request(
87
`POST /repos/cfu288/ansible_inventories/actions/workflows/${process.env.WORKFLOW_ID}/dispatches`,
98
{
109
ref: 'main',
11-
}
10+
},
1211
);
13-
console.log('Stage deploy completed');
12+
console.log('Deploy completed');
1413
} catch (error) {
15-
console.log('Error when attempting to trigger stage deploy:', error);
14+
console.log('Error when attempting to trigger deploy:', error);
1615
process.exit(1);
1716
}
1817
})();

Diff for: .github/workflows/production.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
with:
7373
node-version: 18
7474
- run: npm install @octokit/action
75-
- run: node .github/actions/trigger-stage-deploy.js
75+
- run: node .github/actions/trigger-env-deploy.js
7676
env:
7777
GITHUB_TOKEN: ${{ secrets.PAT_DEPLOY_GITHUB_TOKEN }}
7878
WORKFLOW_ID: ${{ vars.PROD_WORKFLOW_ID }}

Diff for: .github/workflows/staging.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
node-version: 18
4848
- run: npm install @octokit/action
49-
- run: node .github/actions/trigger-stage-deploy.js
49+
- run: node .github/actions/trigger-env-deploy.js
5050
env:
5151
GITHUB_TOKEN: ${{ secrets.PAT_DEPLOY_GITHUB_TOKEN }}
5252
WORKFLOW_ID: ${{ vars.STAGE_WORKFLOW_ID }}

0 commit comments

Comments
 (0)