github · GitHub Actions Docs
How Tos Setting exit codes for actions - GitHub Docs
Explains how to control the success or failure of a GitHub Action by returning specific exit codes from a script or process.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
How Tos Setting exit codes for actions - GitHub Docs
Explains how to control the success or failure of a GitHub Action by returning specific exit codes from a script or process.
When To Use
Use when you need to ensure a GitHub Action job fails or succeeds based on the outcome of a custom script or command-line tool.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/actions-how-tos-create-and-publish-setting-exit-codes-for-github-docs-workflow-guide.md | A guide explaining how to set failure exit codes for JavaScript and Docker container-based GitHub Actions. | Questions about a guide explaining how to set failure exit codes for JavaScript and Docker container-based GitHub Actions. |
examples/actions-how-tos-create-and-publish-setting-exit-codes-for-github-docs-gi.text | A JavaScript code snippet demonstrating how to use core.setFailed to set a non-zero exit code in a GitHub Action. | Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use core.setFailed to set a non-zero exit code in a GitHub Action. |
examples/actions-how-tos-create-and-publish-setting-exit-codes-for-github-docs-gi-2.text | A shell script example demonstrating how to use conditional logic to exit a GitHub Action with a non-zero status code. | Exact payloads, commands, or snippets shown in A shell script example demonstrating how to use conditional logic to exit a GitHub Action with a non-zero status code. |
What This Skill Covers
-
- GitHub Actions / - How-tos / - Create and publish actions / - Set exit codes
- Main sections:
In this article,About exit codes,Setting a failure exit code in a JavaScript action,Setting a failure exit code in a Docker container action.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://docs.github.com/en/actions/how-tos/create-and-publish-actions/set-exit-codes
