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
- Host: GitHub
- URL: https://github.com/stack-spot/runtime-cancel-run-action
- Owner: stack-spot
- License: apache-2.0
- Created: 2023-12-12T15:40:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-18T12:21:28.000Z (about 1 year ago)
- Last Synced: 2024-11-18T13:05:35.651Z (about 1 year ago)
- Topics: cloud-runtime, code, maintain
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# runtime-cancel-run-action
[](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-ubuntu.yaml) [](https://github.com/stack-spot/runtime-cancel-run-action/actions/workflows/action-test-macos.yaml) [](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)