An open API service indexing awesome lists of open source software.

https://github.com/stack-spot/runtime-cancel-run-action

runtime-cancel-run-action
https://github.com/stack-spot/runtime-cancel-run-action

cloud-runtime code maintain

Last synced: 10 months ago
JSON representation

runtime-cancel-run-action

Awesome Lists containing this project

README

          

# runtime-cancel-run-action

[![Action test Ubuntu](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-ubuntu.yaml/badge.svg)](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-ubuntu.yaml) [![Action test MacOS](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-macos.yaml/badge.svg)](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-macos.yaml) [![Action test Windows](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-windows.yaml/badge.svg)](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-windows.yaml)

GitHub action to cancel a run on StackSpot Runtime API.

_**Note**: This action is supported on all runners operating systems (`ubuntu`, `macos`, `windows`)_

## 📚 Usage

### Requirements

To get the account keys (`CLIENT_ID`, `CLIENT_KEY` and `CLIENT_REALM`), please login using a **ADMIN** user on the [StackSpot Portal](https://stackspot.com), and generate new keys at [https://stackspot.com/en/settings/access-token](https://stackspot.com/en/settings/access-token).

### Use Case

```yaml
steps:
- uses: stack-spot/runtime-cancel-run-action@v1
outputs:
run_data: /run_data_output.json
with:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_KEY: ${{ secrets.CLIENT_KEY }}
CLIENT_REALM: ${{ secrets.CLIENT_REALM }}
RUN_ID: ${{ needs.run.outputs.run_id }}
FORCE_CANCEL: true
```

* * *

## ▶️ Action Inputs

Field | Mandatory | Default Value | Observation
------------ | ------------ | ------------- | -------------
**CLIENT_ID** | YES | N/A | [StackSpot](https://stackspot.com/en/settings/access-token) Client ID.
**CLIENT_KEY** | YES | N/A |[StackSpot](https://stackspot.com/en/settings/access-token) Client KEY.
**CLIENT_REALM** | YES | N/A |[StackSpot](https://stackspot.com/en/settings/access-token) Client Realm.
**RUN_ID** | YES | N/A | Run Id generated by [Runtime Manager Action](https://github.com/stack-spot/runtime-manager-action).
**FORCE_CANCEL** | YES | true | Forces the cancel in case Jobs/Workers will no longer respond Run Tasks.

## ▶️ Action Outputs
Field | Description
----- | -----------
**run_data** | Returns json file output with the run data after its cancelled. At /{{workdir}}/run_data_output.json

Output run_data json file structure

```json
{
"runId": "string",
"appId": "string",
"infraId": "string",
"envId": "string",
"deploymentId": "string",
"type": "DEPLOY",
"status": "RUNNING",
"createdAt": "2024-09-27T21:16:23.993Z",
"updatedAt": "2024-09-27T21:16:23.993Z",
"appliedPlugins": [
{
"pluginAppliedAlias": "string",
"tasks": [
{
"id": "string",
"type": "IAC",
"status": "PENDING",
"errorDetails": "string",
"logs": "string"
}
]
}
]
}
```

## License

[Apache License 2.0](https://github.com/stack-spot/runtime-cancel-run-action/blob/main/LICENSE)