From a714e2d55058aa5b93526b2b7e9c3295d601e7ee Mon Sep 17 00:00:00 2001 From: Spc Date: Thu, 6 Mar 2025 00:20:32 +0100 Subject: [PATCH 1/4] Fix typo in 1-make-workflow-reusable.md --- .github/steps/1-make-workflow-reusable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/steps/1-make-workflow-reusable.md b/.github/steps/1-make-workflow-reusable.md index 0d491aa..45e5c2f 100644 --- a/.github/steps/1-make-workflow-reusable.md +++ b/.github/steps/1-make-workflow-reusable.md @@ -10,7 +10,7 @@ _Welcome to "Reusable Workflows and Matrix Strategies"! :wave:_ -You can do a lot with GitHub Actions! You can automate repetitive tasks, build continuous integration and continuous deployment pipelines, and customize essentially any part of your software development workflow. It doesn't matter if you're just learning about workflows and GitHub Actions for the first time or you're well exerpienced with the process, you'll quickly find yourself repeating automation jobs and steps within the same workflow, and even using the dreaded copy and paste method for workflows across multiple repositories. +You can do a lot with GitHub Actions! You can automate repetitive tasks, build continuous integration and continuous deployment pipelines, and customize essentially any part of your software development workflow. It doesn't matter if you're just learning about workflows and GitHub Actions for the first time or you're well experienced with the process, you'll quickly find yourself repeating automation jobs and steps within the same workflow, and even using the dreaded copy and paste method for workflows across multiple repositories. Is there a solution to reduce these repetitive tasks? Yes, I'm glad you asked :wink: Enter **reusable workflows**, a simple and powerful way to avoid copying and pasting workflows across your repositories. From b799ccbe8c585fa84535197003e3786f5a3211a3 Mon Sep 17 00:00:00 2001 From: Spc Date: Thu, 6 Mar 2025 00:22:12 +0100 Subject: [PATCH 2/4] Fix typo in 2-add-a-job.md --- .github/steps/2-add-a-job.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/steps/2-add-a-job.md b/.github/steps/2-add-a-job.md index ee746a8..0728e47 100644 --- a/.github/steps/2-add-a-job.md +++ b/.github/steps/2-add-a-job.md @@ -45,7 +45,7 @@ Okay, now that we know what the reusable workflow is doing, let's now add a new 1. Navigate to the `.github/workflows/` folder and open the `my-starter-workflow.yml` file. 1. Add a new job to the workflow called `call-reusable-workflow`. 1. Add a `uses` command and path the command to the `reusable-workflow.yml` file. -1. Add a `with` command to pass in a `node` paramater and set the value to `14`. +1. Add a `with` command to pass in a `node` parameter and set the value to `14`. ```yaml call-reusable-workflow: From 2e271756816963d9a2a1c20a48fc60df7b12492d Mon Sep 17 00:00:00 2001 From: Spc Date: Thu, 6 Mar 2025 00:23:20 +0100 Subject: [PATCH 3/4] Fix typos in 3-add-matrix-strategy.md --- .github/steps/3-add-matrix-strategy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/steps/3-add-matrix-strategy.md b/.github/steps/3-add-matrix-strategy.md index 1c0a896..4b1142a 100644 --- a/.github/steps/3-add-matrix-strategy.md +++ b/.github/steps/3-add-matrix-strategy.md @@ -25,14 +25,14 @@ To define a matrix strategy inside a job, you first need to define the matrix wi The `example_matrix` job will run for each possible combination of the variables. So, in the above example, the workflow will run six jobs, one for each combination of the os and version variables. If you want to run a job for multiple versions, using a matrix strategy is a great solution over writing out 6 different jobs. -Let's add a matrix strategy to the **My Starter Workflow** so we can run our job on different versions of node instead of the hard-coded single verison of 14. +Let's add a matrix strategy to the **My Starter Workflow** so we can run our job on different versions of node instead of the hard-coded single version of 14. ### :keyboard: Activity: Use a matrix strategy to run multiple versions 1. In the same `my-starter-workflow.yml` file, add a `strategy` keyword under the `call-reusable-workflow` job. 1. Under `strategy`, add a `matrix` keyword. 1. Define the `nodeversion` variable to run over the following versions of node `[14, 16, 18, 20]`. -1. Replace the hard-coded `node` paramter of 14 used in the `with` command, and call the `nodeversion` in the matrix by using the following syntax `${{ matrix.nodeversion }}`. Below is that your job should look like: +1. Replace the hard-coded `node` parameter of 14 used in the `with` command, and call the `nodeversion` in the matrix by using the following syntax `${{ matrix.nodeversion }}`. Below is that your job should look like: ```yaml call-reusable-workflow: From 3f8eaf013e10c44780cc63b87ca5bc648ca225ca Mon Sep 17 00:00:00 2001 From: Spc Date: Thu, 6 Mar 2025 00:24:05 +0100 Subject: [PATCH 4/4] Fix typo in 5-trigger-the-workflow.md --- .github/steps/5-trigger-the-workflow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/steps/5-trigger-the-workflow.md b/.github/steps/5-trigger-the-workflow.md index 852c0af..e071bc2 100644 --- a/.github/steps/5-trigger-the-workflow.md +++ b/.github/steps/5-trigger-the-workflow.md @@ -8,7 +8,7 @@ _You're almost done. Last step! :heart:_ -Now that the changes have been merged into the `main` branch, let's trigger the **My Starter Workflow** workflow to see everyting in action! But before we do, let's recall what we should expect to see before we run the workflow. +Now that the changes have been merged into the `main` branch, let's trigger the **My Starter Workflow** workflow to see everything in action! But before we do, let's recall what we should expect to see before we run the workflow. - We should expect to see five jobs running from our \*My Starter Workflow\*\*. Do you remember which ones? We have the `build` job and then the `call-reusable-workflow` job that has the matrix strategy. ![Screen Shot 2022-09-08 at 9 53 52 AM](https://user-images.githubusercontent.com/6351798/189220189-97361a5e-eecf-4666-a859-e0587354bafe.png)