Skip to main content

このバージョンの GitHub Enterprise サーバーはこの日付をもって終了となりました: 2025-06-04. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise サーバーにアップグレードしてください。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせください

Setting exit codes for actions

You can use exit codes to set the status of an action. GitHub displays statuses to indicate passing or failing actions.

メモ

GitHub ホステッド ランナーは、現在 GitHub Enterprise Server ではサポートされていません。 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 statusCheck run statusDescription
0successThe action completed successfully and other tasks that depend on it can begin.
Nonzero value (any integer but 0)failureAny 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.