GithubHelp home page GithubHelp logo

fountainhead / action-wait-for-check Goto Github PK

View Code? Open in Web Editor NEW
121.0 121.0 44.0 567 KB

A GitHub Action that waits for another Check Run to have completed

License: MIT License

TypeScript 96.49% JavaScript 3.51%

action-wait-for-check's People

Contributors

ichebbi avatar sammcj avatar wms avatar

Stargazers

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

Watchers

 avatar  avatar

action-wait-for-check's Issues

404 when running as part of github action pipeline

I added the following snippet to my .github/workflows/release.yml, based on the marketplace docs docs.

    - name: Wait for build to succeed
      uses: fountainhead/[email protected]
      id: wait-for-build
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        checkName: Go

Output:

Download action repository 'fountainhead/[email protected]'
##[warning]Failed to download action 'https://api.github.com/repos/fountainhead/action-wait-for-check/tarball/1.0.0'. Error Response status code does not indicate success: 404 (Not Found).
##[warning]Back off 19.757 seconds before retry.
##[warning]Failed to download action 'https://api.github.com/repos/fountainhead/action-wait-for-check/tarball/1.0.0'. Error Response status code does not indicate success: 404 (Not Found).
##[warning]Back off 22.384 seconds before retry.
##[error]Response status code does not indicate success: 404 (Not Found).

Not sure if the github release needs a certain binary file or sthg.

Inconsistent check run status returned

Not exactly an issue with this project, but does anyone know why the check run statuses that github returns are inconsistent? Sometimes "completed" is returned, even though the action being waited on is clearly not complete. Other times, it's clear that "in-progress" is correctly returned (based on logging the result from the listForRef call). More importantly, is there a fix that can be applied to this code to ensure the most up-to-date check status is returned?

The best solution I've found so far is to (1) add a delay prior to the call to listForRef() and (2) set the per_page argument to listForRef() to 1. (I don't know how to actually build this, so I'm just hacking index.js.) A proper build can be found in #33.

checkName documentation

Could someone please elaborate on the below documentation. What is this actually referring to what name is it checking? Branch Name, Repo Name?

checkName

Required

The name of the GitHub check to wait for. For example, build or deploy.

Check exits before artifacts from job are available

I am using this action to determine when another workflow finishes so I can download artifacts from it. When the workflow finishes and this action exits cleanly, it appears as though the artifacts are not ready and the workflow fails saying that the artifact doesn't exist.

Is there a way around this? I realize this might not be this action's responsibility. Perhaps the API is showing the run as complete before the artifacts are available? Is there a way for this action to check for that?

Referencing another actions file

Lets say i have a ./.github/workflows/main.yml file, this file runs all the pull-request checks and tests. But then i have another workflow file (./.github/workflows/other.yml). I would like to run this workflow other.yml after this workflow main.yml. But other.yml would only run if main.yml does not fail. How would i implement that with this action? I could not find any documentation of how to implement this outside one file. The reason i would like to do this with two files is because they have different events. And if i combine them it would be like a circular dependencies.

Can anybody clear things up for me? Sorry if its a stupid question because in kinda newbie in ci/cd

Skip workflows?

Works great!
Thank you so much for this awesome work.

I have a special case where not always run all dependent workflows, in this case, the Job with the action keeps waiting 600 sec until timeout. ¿There is a way to handle this?
If the root workflow is skipped, the second workflow with the action must continue without waiting for the timeout.

Thank you for your help.

Feature Request: Support wildcard for checkName

If waiting for a series of checks run against a matrix (i.e. tests), you have to add a check step for each individual job in that matrix.

Example workflow snippet:

      - name: Check acceptance test results (helm)
        uses: fountainhead/[email protected]
        id: acceptance-helm-1-13-12
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          checkName: "Acceptance-Helm (v1.13.12)"
          ref: ${{ github.event.pull_request.head.sha || github.sha }}

      - name: Check acceptance test results (helm)
        uses: fountainhead/[email protected]
        id: acceptance-helm-1-18-0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          checkName: "Acceptance-Helm (v1.18.0)"
          ref: ${{ github.event.pull_request.head.sha || github.sha }}

Wait for latest Run

Great tool however, I have hit an occasional problem.

When I run the action and the waiting action fails. if I re-run the parent action it immediately sees there has been a previous run with a failure and fails, without waiting for the second run.

The code I run is:

       - name: Trigger Development Deployment
         uses: benc-uk/[email protected]
         with:
           workflow: Deploy to PaaS
           token: ${{ secrets.ACTIONS_API_ACCESS_TOKEN }}
           inputs: '{"environment": "Development", "sha": "${{ github.sha }}"}'
           ref: ${{github.ref}}

       - name: Wait for Deployment to Development
         uses: fountainhead/[email protected]
         id: wait-for-deploy
         with:
           token: ${{ secrets.ACTIONS_API_ACCESS_TOKEN}}
           checkName: Deploy Development
           ref: ${{github.ref}}

Retrieving check runs named Deploy Development on DFE-Digital/get-into-teaching-api@refs/heads/master...
Retrieved 1 check runs named Deploy Development
Found a completed check with id 1644407390 and conclusion failure

Is there any chance of a flag that allows 'latest-run: true' so it ignores previous runs?

Referencing a different workflow

I am trying to understand how to correctly use checkName.

I have a workflow A which builds my app and creates a preview of said app under a Github page.
I would like to wait for A to be done, so that I can start workflow B to visit the URL of that page.

I tried using the job name, the step name, added a step id... but to no avail so far. It always says

Retrieving check runs named build on Primajin/genshin-farming-helper@961014fdf4bafdb21ccedb58bf26d1824ff3...
Retrieved 0 check runs named build
No completed checks named build, waiting for 10 seconds...
[...]

https://github.com/Primajin/genshin-farming-helper/actions/runs/7077170272/job/19261203711?pr=139#step:3:8

Do I need to add anything else so that it doesn't wait for something called build in the current workflow, but in all / a different one?

Waiting for check times out

Hi there! Awesome package by the way. I just can't seem to get it to work :) I'm waiting for this check to pass on a PR:

image
As you can see, it has completed.

And have setup this action as follows:

image
But it just sits there and polls forever.

I have tried the github.pull_request.head.sha option for the ref as well with no luck. Any ideas?

Thank you!

Make `checkName` optional

The checkName parameter should be optional. If it is not provided, then the action should wait for all checks for a specified commit to pass.

Can't retrieve result on workflow dispatch event

I have workflow with two jobs, second job at some step waits for first job to finish. Everything works as expected if

on:
 pull_request:
    types: [opened, synchronize, reopened]
 workflow_dispatch:

but if I delete this pull_request trigger and leave only

on:
  workflow_dispatch:

wait step could not get info and prints
Retrieved 0 check runs named ...

Any suggestions?

Question: Wait for all checks with the same name to finish

For example, if I have multiple workflows and they all have a job named test. Is it possible to wait for all of them to finish? For now, I think it only waits for one of them to finish.

Retrieved 6 check runs named test
Found a completed check with id xxxxxx and conclusion success

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.