From 6a704a8ddb95214f4b3895085015351f9647fa25 Mon Sep 17 00:00:00 2001 From: Vinny Martins <41807230+martins-vds@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:49:37 -0600 Subject: [PATCH 01/15] Update setup.md --- labs/setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/labs/setup.md b/labs/setup.md index 2cd443dc..7ee51fe3 100644 --- a/labs/setup.md +++ b/labs/setup.md @@ -8,7 +8,7 @@ References: ## Fork the current repository and enable GitHub Actions -1. Fork the current repository [gh-abcs-actions](https://github.com/githubabcs/gh-abcs-actions) +1. Fork the current repository [gh-abcs-actions](https://github.com/martins-vds/gh-abcs-actions) 2. Optional, copy or clone the repository by importing the repository into your account. 3. Go to `Actions` and see the warning message > Workflows aren’t being run on this forked repository @@ -29,4 +29,4 @@ References: - [ ] Module 6: Self-hosted runners - [ ] Module 7: CI/CD ``` -7. Fetch upstream to get the latest changes from the upstream repository \ No newline at end of file +7. Fetch upstream to get the latest changes from the upstream repository From ef66fe55afd9c8c95303252439f53bdf47349857 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 13:54:45 -0300 Subject: [PATCH 02/15] feat: update GitHub Actions demo workflow --- .github/workflows/github-actions-demo.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index e8540e80..09828d9d 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -3,6 +3,12 @@ on: workflow_dispatch: workflow_call: + push: + branches: + - main + paths: + - 'labs/**' + jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From f27d24df851226139c83f9eb11a9b9f867b8dc67 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 13:55:23 -0300 Subject: [PATCH 03/15] docs: update lab01 --- labs/lab01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab01.md b/labs/lab01.md index 568071c9..9701f1d4 100644 --- a/labs/lab01.md +++ b/labs/lab01.md @@ -6,7 +6,7 @@ References: - [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) - [Adding an action to your workflow](https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions#adding-an-action-to-your-workflow) -## 1.1 Update the workflow to trigger when a change is made to the labs folder on main branch +## 1.1 Update the workflow to trigger when a change is made to the labs folder on main branch (done) 1. Open the workflow file [github-actions-demo.yml](/.github/workflows/github-actions-demo.yml) 2. Edit the file and copy the following YAML content after line 4: From fcfc362984f7331389c22270477e6dd70ed728fd Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:02:36 -0300 Subject: [PATCH 04/15] feat: update GitHub Actions demo workflow and lab01 --- .github/workflows/github-actions-demo.yml | 9 +++++++++ labs/lab01.md | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 09828d9d..bf29a9ab 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -26,3 +26,12 @@ jobs: - run: echo "🍏 This job's status is ${{ job.status }}." - name: Adding markdown run: echo "### Hello world! :rocket:" >> "$GITHUB_STEP_SUMMARY" + + - name: Hello world + uses: actions/hello-world-javascript-action@main + with: + who-to-greet: "Mona the Octocat" + id: hello + # This step prints an output (time) from the previous step's action. + - name: Echo the greeting's time + run: echo 'The time was ${{ steps.hello.outputs.time }}.' diff --git a/labs/lab01.md b/labs/lab01.md index 9701f1d4..9c2c82ee 100644 --- a/labs/lab01.md +++ b/labs/lab01.md @@ -22,7 +22,7 @@ References: 5. Commit the changes into the `main` branch 6. Go to `Actions` and see the details of your running workflow -## 1.2 Add steps to your workflow +## 1.2 Add steps to your workflow (done) 1. Open the workflow file [github-actions-demo.yml](/.github/workflows/github-actions-demo.yml) 2. Edit the file and copy the following YAML content at the end of the file: From 7cf3a88369df6d97751bc5ec08609135786c6757 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:06:28 -0300 Subject: [PATCH 05/15] feat: update job dependencies workflow and lab02 --- .github/workflows/job-dependencies.yml | 35 ++++++++++++++++++++++++++ labs/lab02.md | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index e773fe04..58723646 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -31,3 +31,38 @@ jobs: needs: [fanout1, fanout2] steps: - run: echo "This job will run after fanout1 and fanout2 have finished." + + build: + runs-on: windows-latest + steps: + - run: echo "This job will be run in parallel with the initial job." + test: + runs-on: ubuntu-latest + needs: build + steps: + - run: echo "This job will be run after the build job." + ring01: + runs-on: ubuntu-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring02: + runs-on: macos-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring03: + runs-on: ubuntu-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring04: + runs-on: ubuntu-latest + needs: [ring01,ring02,ring03] + steps: + - run: echo "This job will be run after the ring01,ring02,ring03 jobs." + prod: + runs-on: ubuntu-latest + needs: [ring04] + steps: + - run: echo "This job will be run after the ring04 job." diff --git a/labs/lab02.md b/labs/lab02.md index 0b57698c..11df3622 100644 --- a/labs/lab02.md +++ b/labs/lab02.md @@ -7,7 +7,7 @@ References: - [Using jobs in a workflow](https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow) - [Environment variables](https://docs.github.com/en/actions/learn-github-actions/environment-variables) -## 2.1 Add new jobs with dependencies +## 2.1 Add new jobs with dependencies (done) 1. Open the workflow file [job-dependencies.yml](/.github/workflows/job-dependencies.yml) 2. Edit the file and copy the following YAML content at the end of the file: From 239eacf5b438736a0244417390716f4a4f594e6a Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:08:38 -0300 Subject: [PATCH 06/15] ci: update job dependencies workflow --- .github/workflows/job-dependencies.yml | 37 ++++---------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index 58723646..934a9d75 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -33,36 +33,9 @@ jobs: - run: echo "This job will run after fanout1 and fanout2 have finished." build: - runs-on: windows-latest + runs-on: ubuntu-latest + strategy: + matrix: + configuration: [debug, release] steps: - - run: echo "This job will be run in parallel with the initial job." - test: - runs-on: ubuntu-latest - needs: build - steps: - - run: echo "This job will be run after the build job." - ring01: - runs-on: ubuntu-latest - needs: test - steps: - - run: echo "This job will be run after the test job." - ring02: - runs-on: macos-latest - needs: test - steps: - - run: echo "This job will be run after the test job." - ring03: - runs-on: ubuntu-latest - needs: test - steps: - - run: echo "This job will be run after the test job." - ring04: - runs-on: ubuntu-latest - needs: [ring01,ring02,ring03] - steps: - - run: echo "This job will be run after the ring01,ring02,ring03 jobs." - prod: - runs-on: ubuntu-latest - needs: [ring04] - steps: - - run: echo "This job will be run after the ring04 job." + - run: echo "This job builds the cofiguration ${{ matrix.configuration }}." From 5bdbab576bc2d2fc2aea6001e17200e765a6b5a9 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:12:48 -0300 Subject: [PATCH 07/15] feat: implement matrix build and push trigger in job dependencies workflow --- .github/workflows/job-dependencies.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index 934a9d75..3c1f484c 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -2,9 +2,9 @@ name: 02-2. Dependencies on: workflow_dispatch: - # push: - # branches: - # - main + push: + branches: + - main jobs: initial: From 89e8ee7fd010ea3a37f194f3a3da07f019d341ba Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:15:15 -0300 Subject: [PATCH 08/15] ci: update job dependencies workflow --- .github/workflows/job-dependencies.yml | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index 3c1f484c..f84f648e 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -31,7 +31,6 @@ jobs: needs: [fanout1, fanout2] steps: - run: echo "This job will run after fanout1 and fanout2 have finished." - build: runs-on: ubuntu-latest strategy: @@ -39,3 +38,33 @@ jobs: configuration: [debug, release] steps: - run: echo "This job builds the cofiguration ${{ matrix.configuration }}." + test: + runs-on: ubuntu-latest + needs: build + steps: + - run: echo "This job will be run after the build job." + ring01: + runs-on: ubuntu-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring02: + runs-on: macos-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring03: + runs-on: ubuntu-latest + needs: test + steps: + - run: echo "This job will be run after the test job." + ring04: + runs-on: ubuntu-latest + needs: [ring01,ring02,ring03] + steps: + - run: echo "This job will be run after the ring01,ring02,ring03 jobs." + prod: + runs-on: ubuntu-latest + needs: [ring04] + steps: + - run: echo "This job will be run after the ring04 job." From be584da4ce8d34b57cec8ec84fb8d6f6354762c3 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:20:13 -0300 Subject: [PATCH 09/15] ci: update environments and secrets workflow --- .github/workflows/environments-secrets.yml | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 2b128265..20f28012 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -1,11 +1,11 @@ name: 03-1. Environments and Secrets on: - # push: - # branches: [main] - # pull_request: - # branches: [main] - workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: # Limit the permissions of the GITHUB_TOKEN permissions: @@ -19,6 +19,23 @@ env: DEV_URL: 'https://docs.github.com/en/developers' jobs: + use-secrets: + name: Use secrets + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + steps: + - name: Hello world action with secrets + uses: actions/hello-world-javascript-action@main + with: # Set the secret as an input + who-to-greet: ${{ secrets.MY_REPO_SECRET }} + env: # Or as an environment variable + super_secret: ${{ secrets.MY_REPO_SECRET }} + - name: Echo secret is redacted in the logs + run: | + echo Env secret is ${{ secrets.MY_REPO_SECRET }} + echo Warning: GitHub automatically redacts secrets printed to the log, + echo but you should avoid printing secrets to the log intentionally. + echo ${{ secrets.MY_REPO_SECRET }} | sed 's/./& /g' use-environment-dev: name: Use DEV environment runs-on: ubuntu-latest From 97f9f075457e260bb74bea4c01ce2ad125f192be Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:22:47 -0300 Subject: [PATCH 10/15] ci: update environments and secrets workflow --- .github/workflows/environments-secrets.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/environments-secrets.yml b/.github/workflows/environments-secrets.yml index 20f28012..91020f48 100644 --- a/.github/workflows/environments-secrets.yml +++ b/.github/workflows/environments-secrets.yml @@ -89,12 +89,28 @@ jobs: echo Org secret is ${{ secrets.MY_ORG_SECRET }} echo Env secret is not accessible ${{ secrets.MY_ENV_SECRET }} + use-environment-uat: + name: Use UAT environment + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: use-environment-test + + environment: + name: UAT + url: 'https://uat.github.com' + + steps: + - name: Step that uses the UAT environment + run: echo "Deployment to UAT..." + env: + env_secret: ${{ secrets.MY_ENV_SECRET }} + use-environment-prod: name: Use PROD environment runs-on: ubuntu-latest #if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - needs: use-environment-test + needs: use-environment-uat environment: name: PROD From a45c990fb91f185138f17a081cfce0eba4aa535b Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:27:13 -0300 Subject: [PATCH 11/15] docs: update lab03 --- labs/lab03.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labs/lab03.md b/labs/lab03.md index 27c0755e..38007b3d 100644 --- a/labs/lab03.md +++ b/labs/lab03.md @@ -50,7 +50,7 @@ on: 8. Go to `Actions` and see the details of your running workflow -## 3.2 Add a new workflow job to deploy to UAT environment +## 3.2 Add a new workflow job to deploy to UAT environment (done) 1. Open the workflow file [environments-secrets.yml](/.github/workflows/environments-secrets.yml) 2. Edit the file and copy the following YAML content between the test and prod jobs (before the `use-environment-prod:` line): From f245300f9948844e7378b1f7c3894b19a963ec43 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:30:44 -0300 Subject: [PATCH 12/15] ci: update job dependencies workflow --- .github/workflows/job-dependencies.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index f84f648e..e9d3b239 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -5,6 +5,7 @@ on: push: branches: - main + workflow_call: jobs: initial: From 4e0a62787c1cc7f0d80547e407e2031c6b470d56 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:31:46 -0300 Subject: [PATCH 13/15] Revert "ci: update job dependencies workflow" This reverts commit f245300f9948844e7378b1f7c3894b19a963ec43. --- .github/workflows/job-dependencies.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index e9d3b239..f84f648e 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -5,7 +5,6 @@ on: push: branches: - main - workflow_call: jobs: initial: From dec9b669e882cb702b4436e5c800a08e7b796959 Mon Sep 17 00:00:00 2001 From: Tasso Gomes Date: Tue, 27 Jan 2026 14:32:58 -0300 Subject: [PATCH 14/15] feat: add workflow_call event to job dependencies workflow --- .github/workflows/job-dependencies.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/job-dependencies.yml b/.github/workflows/job-dependencies.yml index f84f648e..e9d3b239 100644 --- a/.github/workflows/job-dependencies.yml +++ b/.github/workflows/job-dependencies.yml @@ -5,6 +5,7 @@ on: push: branches: - main + workflow_call: jobs: initial: From ba283f79c3c9fc3fa75d001103cf329f70cf60fb Mon Sep 17 00:00:00 2001 From: Tasso Silva Gomes Date: Tue, 27 Jan 2026 14:35:00 -0300 Subject: [PATCH 15/15] Add push trigger and dependencies to workflow --- .github/workflows/reusable-workflow-template.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-workflow-template.yml b/.github/workflows/reusable-workflow-template.yml index 33c7858e..b4698c5a 100644 --- a/.github/workflows/reusable-workflow-template.yml +++ b/.github/workflows/reusable-workflow-template.yml @@ -1,7 +1,9 @@ name: 04-1. Call Reusable Workflow Templates -on: - [workflow_dispatch] +on: + push: + branches: [main] + workflow_dispatch: jobs: call_greet_everyone_workflow_job: @@ -15,3 +17,6 @@ jobs: call_demo_workflow_job: needs: call_greet_everyone_workflow_job uses: githubabcs/gh-abcs-actions/.github/workflows/github-actions-demo.yml@main + call_dependencies_workflow_job: + needs: call_reusable_workflow_job + uses: tassosgomes/gh-abcs-actions/.github/workflows/job-dependencies.yml@main