Skip to content

Latest commit

 

History

History
40 lines (37 loc) · 1.95 KB

lab04.md

File metadata and controls

40 lines (37 loc) · 1.95 KB

4 - Workflow Templates

In this lab you will reuse workflow templates.

Duration: 10-15 minutes

References:

4.1 Create a reusable workflow

  1. For a workflow to be reusable, the on must include the workflow_call event
  2. Open the workflow file job-dependencies.yml
  3. Edit the file and update the workflow to run on workflow call event
on:
  workflow_call:
  1. Commit the changes into a new feature/lab04 branch
  2. Go to Code and select the feature/lab04 from the branches drop down list
  3. Open the workflow file reusable-workflow-template.yml
  4. Edit the file and copy the following YAML content at the end of the file:
  call_dependencies_workflow_job:
    needs: call_reusable_workflow_job
    uses: <YOUR_USER_ACCOUNT>/gh-abcs-actions/.github/workflows/job-dependencies.yml@main
  1. Update the workflow to run on push events
on:
  push:
     branches: [main]
  workflow_dispatch:    
  1. Commit the changes into the same feature/lab04 branch
  2. Open a new pull request from Pull requests

Make sure it is your repository pull request to not propose changes to the upstream repository. From the drop-down list choose the base repository to be yours.

  1. Complete the pull request and delete the source branch
  2. Go to Actions and see the details of your running workflow