Coder Social home page Coder Social logo

green-edge / workflow-conclusion-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from technote-space/workflow-conclusion-action

0.0 1.0 0.0 5.38 MB

GitHub action to get workflow conclusion.

License: MIT License

TypeScript 95.48% JavaScript 3.23% Shell 1.29%

workflow-conclusion-action's Introduction

Workflow Conclusion Action

CI Status codecov CodeFactor License: MIT

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

GitHub action to get workflow conclusion.

Table of Contents

Details

generated with TOC Generator

Usage

e.g. Lint => Test => Publish (only tagged) => slack (only if any job fails)

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 # set needs only last job except this job
    runs-on: ubuntu-latest
    if: always() # set always
    steps:
        # run this action to get workflow conclusion
        # You can get conclusion via env (env.WORKFLOW_CONCLUSION)
      - uses: technote-space/workflow-conclusion-action@v2
      - 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' # notify only if failure

Success

Success

Slack action step is skipped because all jobs are success.

Failure

Failure

Slack action step has been executed even if some jobs were skipped.

Author

GitHub (Technote)
Blog

workflow-conclusion-action's People

Contributors

oldhammade avatar technote-space avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.