Coder Social home page Coder Social logo

action-post-run's Introduction

Post-Run GitHub action

A simple GitHub action that enables running post-run steps, once a workflow job has ended.

Inputs

run

Required A command that needs to be run. Default echo "This is a post-run step...".

Example usage

Latest version: 3.1.0

name: Build

on:
  push:
    branches: [ master ]

env:
  GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
  something:
    name: Do something...
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
    
      - uses: webiny/[email protected]
        id: post-run-command
        with:
          run: echo "this thing works!"

      - uses: webiny/[email protected]
        id: another-post-run-command
        with:
          run: echo "this thing works again!"
          working-directory: not-required-but-you-can-provide-it

      - name: 'Running an non-existing command will fail...'
        run: run something that does not exist;

This above configuration will produce the following:

image

ℹī¸ Note the order of execution. The run: echo "this thing works again!" was executed before the run: echo "this thing works!" command.

action-post-run's People

Contributors

adrians5j avatar jirutka avatar keeshux avatar rgriege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

action-post-run's Issues

Explain what this does better than the native syntax?

It's hard to grasp why this action exists, as this feature set is built into Actions today. If this provides a value not provided by GitHub Actions syntax you should add it to the documentation.

The documentation's example runs exactly the same, and much faster, written as the following:

jobs:
  something:
    name: Do something...
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
    
      - id: post-run-command
        needs: non-existent-command
        if: ${{ always() }}
        run: echo "this thing works!"

      - id: another-post-run-command
        needs: non-existent-command
        if: ${{ always() }}
        run: echo "this thing works again!"
        working-directory: not-required-but-you-can-provide-it

      - id: non-existent-command
        name: 'Running an non-existing command will fail...'
        run: run something that does not exist;

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.