Giter VIP home page Giter VIP logo

get-status's Introduction

javscript-action status

Get Status Github action

Github action to get the status checks of a given ref.

Motivation

Not all workflows are supposed to run right after each other. Often we want different triggers, for the workflows. But it is still sometimes relevant to know if all the checks have passed successfully, before executing the next step.

The following workflow is quite common. In this scenario the last step, to release to production, will be done manually and requires all the other workflows to be finished successfully. With this GitHub Action, we can check if that's the case and use the out put to decide if it's safe to deploy the changes to production.

PR -> (Code Review + QA + Unit tests) -> Merge -> (Unit tests, E2E tests, Build) -> Release -> (Deploy to Production)

Inputs

ref (required)

Git ref, e.g. the sha.

Default:

token (optional)

The GitHub token used to create an authenticated client.

Default: github.token.

ignore (optional)

Workflow names that will be ignored during the validation. For multiple values, please separate them with commas, e.g. "test,build,get-status".

Default: []

Outputs

all-checks-completed

Returns true if all checks are completed.

all-checks-passed

Returns true if all checks concluded either with success or skipped.

Example usage

uses: actions/[email protected]
with:
  ref: ${{ github.sha }}
  ignore: 'test,build'

Example workflow

name: Get Status Sample Workflow

on:
  release:
    types: [released]
jobs:
  get-status:
    runs-on: ubuntu-latest
    steps:
      - name: Get Status of current ref
        id: get-status
        uses: danieldeichfuss/get-status@v0
        with:
          ref: ${{ github.sha }}
      - name: Deploy to Production
        if: ${{steps.get-status.outputs.all-checks-completed == 'true' &&  steps.get-status.outputs.all-checks-passed == 'true'}}
        run: echo "Deploying to production"

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.