https://github.com/technote-space/workflow-conclusion-action
GitHub action to get workflow conclusion.
https://github.com/technote-space/workflow-conclusion-action
github-actions
Last synced: 9 months ago
JSON representation
GitHub action to get workflow conclusion.
- Host: GitHub
- URL: https://github.com/technote-space/workflow-conclusion-action
- Owner: technote-space
- License: mit
- Archived: true
- Created: 2020-02-19T08:32:52.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-02-19T09:02:15.000Z (almost 3 years ago)
- Last Synced: 2025-02-28T08:51:05.000Z (10 months ago)
- Topics: github-actions
- Language: TypeScript
- Homepage:
- Size: 7.03 MB
- Stars: 141
- Watchers: 2
- Forks: 38
- Open Issues: 4
-
Metadata Files:
- Readme: README.ja.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Workflow Conclusion Action
[](https://github.com/technote-space/workflow-conclusion-action/actions)
[](https://codecov.io/gh/technote-space/workflow-conclusion-action)
[](https://www.codefactor.io/repository/github/technote-space/workflow-conclusion-action)
[](https://github.com/technote-space/workflow-conclusion-action/blob/main/LICENSE)
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
これはワークフローの結果を取得するための`GitHub Actions`です。
## Table of Contents
Details
- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)
- [Success](#success)
- [Failure](#failure)
- [Author](#author)
*generated with [TOC Generator](https://github.com/technote-space/toc-generator)*
## 使用方法
例:Lint => Test => Publish (タグ付与時のみ) => slack (いずれかのジョブが失敗した場合のみ)
```yaml
on: push
name: CI
jobs:
lint:
name: ESLint
runs-on: ubuntu-latest
...
test:
name: Coverage
needs: lint
strategy:
matrix:
node: ['11', '12']
...
publish:
name: Publish Package
needs: test
if: startsWith(github.ref, 'refs/tags/v')
...
slack:
name: Slack
needs: publish # このjobを除いた最後のjobを"needs"に設定
runs-on: ubuntu-latest
if: always() # "always"を設定
steps:
# workflowの結果を取得するためにこのアクションを実行
# 環境変数から結果を取得できます (env.WORKFLOW_CONCLUSION)
- uses: technote-space/workflow-conclusion-action@v3
# workflowの結果を使用してアクションを実行
- uses: 8398a7/action-slack@v3
with:
# status: ${{ env.WORKFLOW_CONCLUSION }} # neutral, success, skipped, cancelled, timed_out, action_required, failure
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: env.WORKFLOW_CONCLUSION == 'failure' # 失敗を通知する場合
```
### Success

すべてのジョブが正常だったため、Slackアクションはスキップされます。
### Failure

いくつかのジョブがスキップされた場合でもSlackアクションは実行されます。
## Author
[GitHub (Technote)](https://github.com/technote-space)
[Blog](https://technote.space)