githubtraining / exercise-scheduled-events

A hands-on exercise using GitHub Actions. See README.md for instructions on how to get started.
Creative Commons Attribution 4.0 International
1 stars 2 forks source link

Add a workflow status badge #1

Open hectorsector opened 3 years ago

hectorsector commented 3 years ago

Suggested by @jonlipsky on Slack:

a “build badge” in the readme (main page) of the repo to know if you’ve successfully completed the exercise

For this lab it might be a little tricker; we're asking the learner to perform their actions on branches other than main. When configuring the workflow badge I'm not sure how we'd display the badge for a branch that's not yet created but maybe there's something that's not obvious to me that @mattdavis0351 can see.

Screen Shot 2021-02-04 at 9 56 14 AM
a-a-ron commented 3 years ago

Hey @hectorsector, I think I got this to work. I'll run through it after our daily standup to make sure.

We need to change the workflow name from Grading workflow to Grading-workflow, and then add the following to the README:

[![Grading-workflow Actions Status](https://github.com/{userName}/{repoName}/workflows/{workflowName}/badge.svg?branch=my-workflows)](https://github.com/{userName}/{repoName}/actions)

Of course, this would need the ability to use environment variables which could result in another action since we don't really have a way to do that easily ... thinking of alternatives 🤔

hectorsector commented 3 years ago

Thanks for this, @a-a-ron!

I'm holding off on this since we don't have an easy way to replace or use variables for the user and repo name fields in the URL.

mattdavis0351 commented 3 years ago

@hectorsector we may be able to address this through the API somehow. I think the bigger question would be which piece of the lab is responsible for this? Should Looking Glass set this status badge or should it exist at the template repo level and get updated by workflow check suite state?

I think figuring out if we can do this via API first will help answer those questions