[Github Actions] Contexts and steps if conditionals are unusable with incomplete docs

When I echo the context for steps as mentioned in the docs i get {} and job just has two fields. 

GitHub Actions Contexts:

https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#contexts

Status check functions:

https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#status-check-functions

In the workflow syntax it is clear that failure should have been <font face="terminal,monaco">failure()</font>

https://help.github.com/en/articles/workflow-syntax-for-github-actions#example-using-status-check-functions

Currently selecting on which step's success/failure should another step be triggered is not working it seems.

i.e

steps:
name: my first step
if: job.steps.<step id>.status == failure

^ the above snippet from the doc is not working.

2 Likes

Hey @geekodour,

Thanks again for taking the time to report this, we are working on it internally and I’ll post an update here as soon as I have news.

Thanks again. Meanwhile, we’re looking forward to seeing you around!

Just to be even more clear about my question, I think job.steps.\<step_id\>.status does not exist yet. as job context is just

{
  "status": "Success"
}

and steps context is just {}

1 Like

@andreagriffiths11 any update on this?  

While i understand that the product is still in beta, I think it is more useful to only release docs for api/endpoints that work; not things that we hope will work in the future.

Time is my most valuable asset and it is really frustrating to invest time using/learning a new product only to learn that particular endpoint isn’t working “YET” and no clear instructions on alternatives to use in the meantime.

2 Likes

Try

if: job.steps.<step id>.status == failure()

It doesn’t work either way because job.steps.<step id>.status is null. job is the following simple object:

{
    "status": "Success"
}

As you can see, it doesn’t even have a steps property, let alone anything below that.

Since I’m finding many parts of the docs are still more like a whishlist, I’m starting this repo, that tracks progress of the missing features: https://github.com/meeDamian/github-actions-bugs/actions, I’ll be adding one feature check, per scheduled daily workflow file.  Feel free to contribute, or peek-in to see if it’s already implemented :).

That is a bug in the docs that I have opened a PR for.  You can’t compare the status of an individual step, you can just check the status of the entire job to that point.  The built in status functions in that doc compare against the overall job status.

2 Likes