Note: GitHub Actions was available for GitHub Enterprise Server 2.22 as a limited beta. The beta has ended. GitHub Actions is now generally available in GitHub Enterprise Server 3.0 or later. For more information, see the GitHub Enterprise Server 3.0 release notes.
- For more information about upgrading to GitHub Enterprise Server 3.0 or later, see "Upgrading GitHub Enterprise Server."
- For more information about configuring GitHub Actions after you upgrade, see the documentation for GitHub Enterprise Server 3.0.
Note: GitHub-hosted runners are not currently supported on GitHub Enterprise Server. You can see more information about planned future support on the GitHub public roadmap.
About exit codes
GitHub uses the exit code to set the action's check run status, which can be success
or failure
.
Exit status | Check run status | Description |
---|---|---|
0 | success | The action completed successfully and other tasks that depends on it can begin. |
Nonzero value (any integer but 0) | failure | Any other exit code indicates the action failed. When an action fails, all concurrent actions are canceled and future actions are skipped. The check run and check suite both get a failure status. |
Setting a failure exit code in a JavaScript action
If you are creating a JavaScript action, you can use the actions toolkit @actions/core
package to log a message and set a failure exit code. For example:
try {
// something
} catch (error) {
core.setFailed(error.message);
}
For more information, see "Creating a JavaScript action."
Setting a failure exit code in a Docker container action
If you are creating a Docker container action, you can set a failure exit code in your entrypoint.sh
script. For example:
if <condition> ; then
echo "Game over!"
exit 1
fi
For more information, see "Creating a Docker container action."