Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

workflow-conclusion-action 3.0.0

Install from the command line:
Learn more about npm packages
$ npm install @technote-space/workflow-conclusion-action@3.0.0
Install via package.json:
"@technote-space/workflow-conclusion-action": "3.0.0"

About this version

Workflow Conclusion Action

CI Status codecov CodeFactor License: MIT

Read this in other languages: English, 日本語.

これはワークフローの結果を取得するためのGitHub Actionsです。

Table of Contents

Details

generated with TOC Generator

使用方法

例:Lint => Test => Publish (タグ付与時のみ) => slack (いずれかのジョブが失敗した場合のみ)

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

Success

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

Failure

Failure

いくつかのジョブがスキップされた場合でもSlackアクションは実行されます。

Author

GitHub (Technote)
Blog

Details


Assets

  • workflow-conclusion-action-3.0.0-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0