GithubHelp home page GithubHelp logo

chdanielmueller / set-deployment-status Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avakar/set-deployment-status

0.0 0.0 0.0 282 KB

Update the status of a GitHub deployment

License: MIT License

JavaScript 100.00%

set-deployment-status's Introduction

GitHub Action โ€“ Set GitHub deployment status

Update the status of a deployment in your repo. Use in your workflows that react to the deployment event.

Usage

Create a new deployment, either from your tooling or from another workflow (using avakar/create-deployment, for example). Then include this action in your deployment workflow.

on: deploy
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: avakar/set-deployment-status@v1
        with:
          state: in_progress
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - run: |
        echo 'Performing the deployment...'
        sleep 10
      - uses: avakar/set-deployment-status@v1
        with:
          state: success
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - uses: avakar/set-deployment-status@v1
        if: failure()
        with:
          state: failure
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Petition GitHub to allow success/failure context functions outside of the if entry and then you'll be able to replace the last two steps with the following.

      - uses: avakar/set-deployment-status@v1
        if: always()
        with:
          state: ${{ success() }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Or, better yet, let actions retrieve the status on their own and then we can do the final update as a post-action.

Inputs

See the Developer API documentation for an explanation of the input parameters. Both ant-man and flash previews are enabled.

  • state: required, one of error, failure, inactive, in_progress, queued, pending, or success.
  • deployment_id: defaults to github.event.deployment.id; you don't have to specify it if you're being triggered by the "deployment" event.
  • auto_inactive: defaults to true
  • description
  • environment_url
  • log_url
  • owner: defaults to the current repository's owner
  • repo: defaults to the current repository

Outputs

  • deployment_status_id: the numeric ID of the new deployment status
  • deployment_status_url: the API url of the new deployment status

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.