-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04c3e22
commit 13e0d92
Showing
6 changed files
with
41,262 additions
and
55,526 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
}, | ||
"author": "[email protected]", | ||
"license": "ISC", | ||
"type": "module", | ||
"devDependencies": { | ||
"@jest/globals": "^29.7.0", | ||
"@tsconfig/node20": "^20.1.4", | ||
|
@@ -29,8 +30,7 @@ | |
"dependencies": { | ||
"@actions/core": "^1.10.1", | ||
"@actions/github": "^5.1.1", | ||
"@humanitec/autogen": "^0.0.9", | ||
"axios": "^1.6.8", | ||
"@humanitec/autogen": "^0.0.10", | ||
"mustache": "^4.2.0" | ||
}, | ||
"private": true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import * as core from '@actions/core'; | ||
import {runAction} from './action'; | ||
import axios from 'axios'; | ||
import {runAction} from './action.js'; | ||
import { ResponseError } from '@humanitec/autogen'; | ||
Check failure on line 3 in src/index.ts GitHub Actions / test (20.x)
Check failure on line 3 in src/index.ts GitHub Actions / test (20.x)
Check failure on line 3 in src/index.ts GitHub Actions / test (22.x)
|
||
|
||
runAction().catch((e) => { | ||
runAction().catch(async (e) => { | ||
core.error('Action failed'); | ||
|
||
core.setFailed(`${e.name} ${e.message}`); | ||
if (axios.isAxiosError(e)) { | ||
if (e.config) { | ||
core.error(`method: ${e.config.method}`); | ||
core.error(`request: ${e.config.url}`); | ||
} | ||
if (e.response) { | ||
core.error(`response: ${JSON.stringify(e.response.data)}`); | ||
|
||
if (e instanceof ResponseError) { | ||
const {response} = e; | ||
core.error(`API response:`); | ||
core.error(`status: ${response.status}`); | ||
if (response.body && response.bodyUsed) { | ||
core.error(`response: ${await response.text()}`); | ||
} | ||
} | ||
}); |