goatintheshell / github-actions-for-ci

https://lab.github.com/githubtraining/github-actions:-continuous-integration
MIT License
0 stars 0 forks source link

A custom workflow #6

Closed github-learning-lab[bot] closed 2 years ago

github-learning-lab[bot] commented 2 years ago

Partial workflow

Remember the custom workflow we are attempting to create for the team? Here's our status on the list of requirements we defined:

The last three remaining items don't really belong in a code, build, and test pipeline because they have to do with processes that involve humans.

Step 14: Automate the review process

GitHub Actions can run multiple workflows for different event triggers. Let's create a new approval workflow that'll work together with our Node.js workflow.

:keyboard: Activity: Add a new workflow file to automate the team's review process

  1. Create a new file, .github/workflows/approval-workflow.yml, on this branch
  2. Enter a name for your workflow in the new file, something like:
    name: Team awesome's approval workflow

I'll respond when you commit to this branch.

github-learning-lab[bot] commented 2 years ago

Choose the event

Great job creating a new workflow!

As we briefly discussed earlier, workflows can be configured to run:

Full details are available in Events that trigger workflows on GitHub Help. So far, we've used the push event for our Node.js workflow. That makes sense when we want to take action on code changes to our repository.

For a review workflow, we want to engage with human reviews, instead. For example, we'll use the Label approved pull requests action so that we can easily see when we've gotten enough reviews to merge a pull request.

Let's prep our review workflow by triggering it with a pull_request_review event.

github-learning-lab[bot] commented 2 years ago

Add a job

Great work! Let's get some more practice with jobs. Apply the suggested change below or follow the instructions.

In a later step, we'll use an action that adds a label to any pull requests after a preset number of approvals. These labels could be used as a visual indicator to your team that something is ready to merge, or even as a way to use other actions or tools to automatically merge pull requests when they receive the required number of approvals.

github-learning-lab[bot] commented 2 years ago

Add a step

We've now got a job with the labelWhenApproved identifier. We're off to a great start!

It's now time to use a community-created action. The action we'll use is pullreminders/label-when-approved-action.

Step 17: Automate approvals

icon of a review approval

Let's see if you can use this action on your own.

If you'd like a hint, submit a comment on this pull request with the word "hint".

Here's some tips to get you going:

:keyboard: Activity: Use the community action to automate part of the review approval process

  1. Using your prior knowledge, configure the pullreminders/label-when-approved-action action in this workflow

I'll respond when you push a new commit to this branch.