-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
In post step, we will send cancel request to TF to cancel pending Test run.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,3 +93,5 @@ outputs: | |
runs: | ||
using: node20 | ||
main: dist/index.js | ||
post-if: cancelled() | ||
post: dist/index.js |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { getInput } from '@actions/core'; | ||
import TestingFarmAPI from 'testing-farm'; | ||
|
||
async function post(): Promise<void> { | ||
const tfInstance = getInput('api_url'); | ||
const tfRequestId = process.env['OUTPUT_REQUEST_ID']; | ||
|
||
const api = new TestingFarmAPI(tfInstance); | ||
|
||
if (!tfRequestId) { | ||
throw new Error('POST: Missing Testing Farm request id'); | ||
} | ||
|
||
const request = { | ||
api_key: getInput('api_key', { required: true }), | ||
}; | ||
|
||
await api.cancelRequest(tfRequestId, request, false); | ||
} | ||
|
||
export default post; |