From 23d8197b6e7357e4ad3ddcd8d44eacc26f62e839 Mon Sep 17 00:00:00 2001
From: ian-smithers <91037329+ian-smithers@users.noreply.github.com>
Date: Mon, 13 May 2024 15:32:14 +1000
Subject: [PATCH] Initial commit
---
.github/dependabot.yml | 6 ++
.github/script/merge-branch.sh | 22 ++++++
.github/steps/-step.txt | 1 +
.github/steps/0-welcome.md | 1 +
.github/steps/1-add-a-test-workflow.md | 45 +++++++++++
.github/steps/2-fix-the-test.md | 35 +++++++++
.github/steps/3-upload-test-reports.md | 42 +++++++++++
.github/steps/4-add-branch-protections.md | 25 +++++++
.github/steps/5-merge-your-pull-request.md | 17 +++++
.github/steps/X-finish.md | 25 +++++++
.github/workflows/0-welcome.yml | 64 ++++++++++++++++
.github/workflows/1-add-a-test-workflow.yml | 73 ++++++++++++++++++
.github/workflows/2-fix-the-test.yml | 67 +++++++++++++++++
.github/workflows/3-upload-test-reports.yml | 73 ++++++++++++++++++
.../workflows/4-add-branch-protections.yml | 73 ++++++++++++++++++
.../workflows/5-merge-your-pull-request.yml | 65 ++++++++++++++++
.gitignore | 43 +++++++++++
LICENSE | 7 ++
README.md | 75 +++++++++++++++++++
resume.md | 28 +++++++
20 files changed, 787 insertions(+)
create mode 100644 .github/dependabot.yml
create mode 100755 .github/script/merge-branch.sh
create mode 100644 .github/steps/-step.txt
create mode 100644 .github/steps/0-welcome.md
create mode 100644 .github/steps/1-add-a-test-workflow.md
create mode 100644 .github/steps/2-fix-the-test.md
create mode 100644 .github/steps/3-upload-test-reports.md
create mode 100644 .github/steps/4-add-branch-protections.md
create mode 100644 .github/steps/5-merge-your-pull-request.md
create mode 100644 .github/steps/X-finish.md
create mode 100644 .github/workflows/0-welcome.yml
create mode 100644 .github/workflows/1-add-a-test-workflow.yml
create mode 100644 .github/workflows/2-fix-the-test.yml
create mode 100644 .github/workflows/3-upload-test-reports.yml
create mode 100644 .github/workflows/4-add-branch-protections.yml
create mode 100644 .github/workflows/5-merge-your-pull-request.yml
create mode 100644 .gitignore
create mode 100644 LICENSE
create mode 100644 README.md
create mode 100644 resume.md
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..8ac6b8c
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "monthly"
diff --git a/.github/script/merge-branch.sh b/.github/script/merge-branch.sh
new file mode 100755
index 0000000..c54c336
--- /dev/null
+++ b/.github/script/merge-branch.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+# Make sure this file is executable
+# chmod a+x .github/script/merge-branch.sh
+
+# USAGE: This script is used to merge a branch into another branch
+
+# BACKGROUND: This operation is required to avoid conflicts between branches.
+
+# Setup committer identity
+git config user.name github-actions[bot]
+git config user.email github-actions[bot]@users.noreply.github.com
+
+# Merge branch
+echo "If branch $branch2 exists, merge branch $branch1 into branch $branch2"
+if git show-ref --quiet refs/heads/$branch2
+then
+ git checkout $branch2
+ git merge $branch1
+ git push origin $branch2
+else
+ echo "Branch $branch2 does not exist"
+fi
diff --git a/.github/steps/-step.txt b/.github/steps/-step.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/.github/steps/-step.txt
@@ -0,0 +1 @@
+0
diff --git a/.github/steps/0-welcome.md b/.github/steps/0-welcome.md
new file mode 100644
index 0000000..9ff13a5
--- /dev/null
+++ b/.github/steps/0-welcome.md
@@ -0,0 +1 @@
+
diff --git a/.github/steps/1-add-a-test-workflow.md b/.github/steps/1-add-a-test-workflow.md
new file mode 100644
index 0000000..c326a83
--- /dev/null
+++ b/.github/steps/1-add-a-test-workflow.md
@@ -0,0 +1,45 @@
+
+
+## Step 1: Add a test workflow
+
+_Welcome to "GitHub Actions: Continuous Integration"! :wave:_
+
+**What is _continuous integration_?**: [Continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) can help you stick to your team’s quality standards by running tests and reporting the results on GitHub. CI tools run builds and tests, triggered by commits. The quality results post back to GitHub in the pull request. The goal is fewer issues in `main` and faster feedback as you work.
+
+![An illustration with a left half and a right half. On the left: illustration of how GitHub Actions terms are encapsulated. At the highest level: workflows and event triggers. Inside workflows: jobs and definition of the build environment. Inside jobs: steps. Inside steps: a call to an action. On the right: the evaluated sequence: workflow, job, step, action.](https://user-images.githubusercontent.com/6351798/88589835-f5ce0900-d016-11ea-8c8a-0e7d7907c713.png)
+
+- **Workflow**: A workflow is a unit of automation from its start to finish, including the definition of what triggers the automation, what environment or other aspects should be taken into account during the automation, and what should happen as a result of the trigger.
+- **Job**: A job is a section of the workflow, and is made up of one or more steps. In this section of our workflow, the template defines the steps that make up the `build` job.
+- **Step**: A step represents one _effect_ of the automation. A step could be defined as a GitHub Action, or another unit, like printing something to the console.
+- **Action**: An action is a piece of automation written in a way that is compatible with workflows. Actions can be written by GitHub, by the open source community, or you can write them yourself!
+
+To learn more, check out [Workflow syntax for GitHub Actions](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions) in the GitHub Docs.
+
+First, let's add a workflow to lint (clean, like a lint roller) our Markdown files in this repository.
+
+### :keyboard: Activity: Add a test workflow
+
+1. Open a new browser tab, and work through the following steps in that tab while you read the instructions in this tab.
+1. Go to the **Actions tab**.
+1. Click **New workflow**.
+1. Search for "Simple workflow" and click **Configure**.
+1. Name your workflow `ci.yml`.
+1. Update the workflow by deleting the last two steps.
+1. Add the following step at the end of your workflow:
+ ```yml
+ - name: Run markdown lint
+ run: |
+ npm install remark-cli remark-preset-lint-consistent
+ npx remark . --use remark-preset-lint-consistent --frail
+ ```
+ > Even after the code is indented properly in `ci.yml`, you will see a build error in GitHub Actions. We'll fix this in the next step.
+1. Click **Commit changes...**, and choose to make a new branch named `ci`.
+1. Click **Propose changes**.
+1. Click **Create pull request**.
+1. Wait about 20 seconds and then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/actions) will automatically update to the next step.
diff --git a/.github/steps/2-fix-the-test.md b/.github/steps/2-fix-the-test.md
new file mode 100644
index 0000000..fbe53a9
--- /dev/null
+++ b/.github/steps/2-fix-the-test.md
@@ -0,0 +1,35 @@
+
+
+## Step 2: Fix the test
+
+_Great job adding the templated workflow! :tada:_
+
+Adding that file to this branch is enough for GitHub Actions to begin running CI on your repository.
+
+When a GitHub Actions workflow is running, you should see some checks in progress, like the screenshot below.
+
+
+
+You can follow along as GitHub Actions runs your job by going to the **Actions** tab or by clicking "Details" in the merge box below.
+
+When the tests finish, you'll see a red X :x: or a green check mark :heavy_check_mark: in the merge box. At that point, you can access the logs for the build job and its associated steps.
+
+_By looking at the logs, can you identify which tests failed?_ To find it, go to one of the failed builds and scroll through the log. Look for a section that lists all the unit tests. We're looking for the name of the test with an "x".
+
+
+
+If the checks don't appear or if the checks are stuck in progress, there's a few things you can do to try and trigger them:
+
+- Refresh the page, it's possible the workflow ran and the page just hasn't been updated with that change.
+- Try making a commit on this branch. Our workflow is triggered with a `push` event, and committing to this branch will result in a new `push`.
+- Edit the workflow file on GitHub and ensure there are no red lines indicating a syntax problem.
+
+### :keyboard: Activity: Fix the test
+
+1. Update the contents in the `ci` branch to get the test to pass. You need to look at the logs to see what caused the test to fail.
+1. **Commit changes**.
+1. Wait about 20 seconds and then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/actions) will automatically update to the next step.
diff --git a/.github/steps/3-upload-test-reports.md b/.github/steps/3-upload-test-reports.md
new file mode 100644
index 0000000..12f2a23
--- /dev/null
+++ b/.github/steps/3-upload-test-reports.md
@@ -0,0 +1,42 @@
+
+
+## Step 3: Upload test reports
+
+_The workflow has finished running! :sparkles:_
+
+So what do we do when we need the work product of one job in another? We can use the built-in [artifact storage](https://docs.github.com/actions/advanced-guides/storing-workflow-data-as-artifacts) to save artifacts created from one job to be used in another job within the same workflow.
+
+To upload artifacts to the artifact storage, we can use an action built by GitHub: [`actions/upload-artifacts`](https://github.com/actions/upload-artifact).
+
+### :keyboard: Activity: Upload test reports
+
+1. Edit your workflow file.
+1. Update the `Run markdown lint` step in your `build` job to use `vfile-reporter-json` and output the results to `remark-lint-report.json`.
+1. Add a step to your `build` job that uses the `upload-artifact` action. This step should upload the `remark-lint-report.json` file generated by the updated `Run markdown lint` step.
+1. Your new `build` should look like this:
+
+ ```yml
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Run markdown lint
+ run: |
+ npm install remark-cli remark-preset-lint-consistent vfile-reporter-json
+ npx remark . --use remark-preset-lint-consistent --report vfile-reporter-json 2> remark-lint-report.json
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: remark-lint-report
+ path: remark-lint-report.json
+ ```
+
+1. Commit your change to this branch.
+1. Wait about 20 seconds and then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/actions) will automatically update to the next step.
+
+Like the upload action to send artifacts to the storage, you can use the download action to download these previously uploaded artifacts from the `build` job: [`actions/download-artifact`](https://github.com/actions/download-artifact). For brevity, we'll skip that step for this course.
diff --git a/.github/steps/4-add-branch-protections.md b/.github/steps/4-add-branch-protections.md
new file mode 100644
index 0000000..0bbb492
--- /dev/null
+++ b/.github/steps/4-add-branch-protections.md
@@ -0,0 +1,25 @@
+
+
+## Step 4: Add branch protections
+
+_Great job uploading test reports! :partying_face:_
+
+Take a look at the merge box, you'll notice you can merge this even though the review process hasn't been met.
+
+Protected branches ensure that collaborators on your repository cannot make irrevocable changes to branches. Enabling protected branches also allows you to enable other optional checks and requirements, like required status checks and required reviews.
+
+### :keyboard: Activity: Add branch protections
+
+1. Go to **Branches** settings. You can navigate to that page manually by selecting the right-most tab in the top of the repository called **Settings** and then clicking **Branches**.
+1. Click **Add branch protection rule** under "Branch protection rules".
+1. Type `main` in **Branch name pattern**.
+1. Check **Require a pull request before merging**.
+1. Uncheck **Require approvals**.
+1. Check **Require status checks to pass before merging**.
+1. Check all build and test jobs that you'd like to see in the newly visible gray box.
+1. Click **Create**.
+1. _Once you turn on branch protection, Actions can no longer push directly to the `main` branch. Wait about 20 seconds and then go to the `ci` branch. [GitHub Actions](https://docs.github.com/actions) will automatically update to the next step on the `ci` branch. You'll need to follow instructions on this branch._
diff --git a/.github/steps/5-merge-your-pull-request.md b/.github/steps/5-merge-your-pull-request.md
new file mode 100644
index 0000000..f3c3ebe
--- /dev/null
+++ b/.github/steps/5-merge-your-pull-request.md
@@ -0,0 +1,17 @@
+
+
+## Step 5: Merge your pull request
+
+_Almost there! :heart:_
+
+You can now [merge](https://docs.github.com/get-started/quickstart/github-glossary#merge) your pull request!
+
+### :keyboard: Activity: Merge your pull request
+
+1. Go to the **Pull requests** tab.
+1. Click **Merge pull request**.
+1. _Once you turn on branch protection, Actions can no longer push directly to the `main` branch. Make sure that you're on the `ci` branch in the page you're following instructions from._ Wait about 20 seconds and then refresh the page. [GitHub Actions](https://docs.github.com/actions) will automatically update to the next step.
diff --git a/.github/steps/X-finish.md b/.github/steps/X-finish.md
new file mode 100644
index 0000000..2c519e5
--- /dev/null
+++ b/.github/steps/X-finish.md
@@ -0,0 +1,25 @@
+
+
+## Finish
+
+_Congratulations friend, you've completed this course!_
+
+
+
+Here's a recap of all the tasks you've accomplished in your repository:
+
+- We created an Actions workflow to lint our Markdown files.
+- You caught an issue in a file and fixed the issue before it could make it to `main`.
+- You learned how to use build artifacts for test reports.
+- You enabled branch protections to require the workflow to pass before merging.
+
+### What's next?
+
+- Get more ideas of what you can do with [awesome actions](https://github.com/sdras/awesome-actions).
+- We'd love to hear what you thought of this course [in our discussion board](https://github.com/orgs/skills/discussions/categories/test-with-actions).
+- [Take another GitHub Skills course](https://github.com/skills).
+- [Read the GitHub Getting Started docs](https://docs.github.com/get-started).
+- To find projects to contribute to, check out [GitHub Explore](https://github.com/explore).
diff --git a/.github/workflows/0-welcome.yml b/.github/workflows/0-welcome.yml
new file mode 100644
index 0000000..a98f881
--- /dev/null
+++ b/.github/workflows/0-welcome.yml
@@ -0,0 +1,64 @@
+name: Step 0, Welcome
+
+# This step triggers after the learner creates a new repository from the template.
+# This workflow updates from step 0 to step 1.
+
+# This will run every time we create push a commit to `main`.
+# Reference: https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+
+# Reference: https://docs.github.com/actions/security-guides/automatic-token-authentication
+permissions:
+ # Need `contents: read` to checkout the repository.
+ # Need `contents: write` to update the step metadata.
+ contents: write
+
+jobs:
+ # Get the current step to only run the main job when the learner is on the same step.
+ get_current_step:
+ name: Check current step number
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: get_step
+ run: |
+ echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
+ outputs:
+ current_step: ${{ steps.get_step.outputs.current_step }}
+
+ on_start:
+ name: On start
+ needs: get_current_step
+
+ # We will only run this action when:
+ # 1. This repository isn't the template repository.
+ # 2. The step is currently 0.
+ # Reference: https://docs.github.com/actions/learn-github-actions/contexts
+ # Reference: https://docs.github.com/actions/learn-github-actions/expressions
+ if: >-
+ ${{ !github.event.repository.is_template
+ && needs.get_current_step.outputs.current_step == 0 }}
+
+ # We'll run Ubuntu for performance instead of Mac or Windows.
+ runs-on: ubuntu-latest
+
+ steps:
+ # We'll need to check out the repository so that we can edit the README.
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Let's get all the branches.
+
+ # In README.md, switch step 0 for step 1.
+ - name: Update to step 1
+ uses: skills/action-update-step@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ from_step: 0
+ to_step: 1
+ branch_name: ci
diff --git a/.github/workflows/1-add-a-test-workflow.yml b/.github/workflows/1-add-a-test-workflow.yml
new file mode 100644
index 0000000..4a946c4
--- /dev/null
+++ b/.github/workflows/1-add-a-test-workflow.yml
@@ -0,0 +1,73 @@
+name: Step 1, Add a test workflow
+
+# This step triggers after push to the ci.yml file on the ci branch.
+# This workflow updates from step 1 to step 2.
+
+# This will run every time we push to the ci.yml file on the ci branch.
+# Reference: https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - ci
+ paths:
+ - .github/workflows/ci.yml
+
+# Reference: https://docs.github.com/actions/security-guides/automatic-token-authentication
+permissions:
+ # Need `contents: read` to checkout the repository.
+ # Need `contents: write` to update the step metadata.
+ contents: write
+
+jobs:
+ # Get the current step to only run the main job when the learner is on the same step.
+ get_current_step:
+ name: Check current step number
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: get_step
+ run: |
+ echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
+ outputs:
+ current_step: ${{ steps.get_step.outputs.current_step }}
+
+ on_push_ci_file:
+ name: On push ci file
+ needs: get_current_step
+
+ # We will only run this action when:
+ # 1. This repository isn't the template repository.
+ # 2. The step is currently 1.
+ # Reference: https://docs.github.com/actions/learn-github-actions/contexts
+ # Reference: https://docs.github.com/actions/learn-github-actions/expressions
+ if: >-
+ ${{ !github.event.repository.is_template
+ && needs.get_current_step.outputs.current_step == 1 }}
+
+ # We'll run Ubuntu for performance instead of Mac or Windows.
+ runs-on: ubuntu-latest
+
+ steps:
+ # We'll need to check out the repository so that we can edit the README.
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Let's get all the branches.
+
+ # Verify the learner added remark-lint.
+ - name: Verify workflow
+ uses: skills/action-check-file@v1
+ with:
+ file: .github/workflows/ci.yml
+ search: remark-preset-lint-consistent
+
+ # In README.md, switch step 1 for step 2.
+ - name: Update to step 2
+ uses: skills/action-update-step@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ from_step: 1
+ to_step: 2
+ branch_name: ci
diff --git a/.github/workflows/2-fix-the-test.yml b/.github/workflows/2-fix-the-test.yml
new file mode 100644
index 0000000..d249925
--- /dev/null
+++ b/.github/workflows/2-fix-the-test.yml
@@ -0,0 +1,67 @@
+name: Step 2, Fix the test
+
+# This step triggers after we push to README.md on the ci branch.
+# This workflow updates from step 2 to step 3.
+
+# This will run every time we push to README.md on the ci branch.
+# Reference: https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - ci
+ paths:
+ - README.md
+ - resume.md
+
+# Reference: https://docs.github.com/actions/security-guides/automatic-token-authentication
+permissions:
+ # Need `contents: read` to checkout the repository.
+ # Need `contents: write` to update the step metadata.
+ contents: write
+
+jobs:
+ # Get the current step to only run the main job when the learner is on the same step.
+ get_current_step:
+ name: Check current step number
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: get_step
+ run: |
+ echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
+ outputs:
+ current_step: ${{ steps.get_step.outputs.current_step }}
+
+ on_fix_test:
+ name: On fix test
+ needs: get_current_step
+
+ # We will only run this action when:
+ # 1. This repository isn't the template repository.
+ # 2. The step is currently 2.
+ # Reference: https://docs.github.com/actions/learn-github-actions/contexts
+ # Reference: https://docs.github.com/actions/learn-github-actions/expressions
+ if: >-
+ ${{ !github.event.repository.is_template
+ && needs.get_current_step.outputs.current_step == 2 }}
+
+ # We'll run Ubuntu for performance instead of Mac or Windows.
+ runs-on: ubuntu-latest
+
+ steps:
+ # We'll need to check out the repository so that we can edit the README.
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Let's get all the branches.
+
+ # In README.md, switch step 2 for step 3.
+ - name: Update to step 3
+ uses: skills/action-update-step@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ from_step: 2
+ to_step: 3
+ branch_name: ci
diff --git a/.github/workflows/3-upload-test-reports.yml b/.github/workflows/3-upload-test-reports.yml
new file mode 100644
index 0000000..eb064f6
--- /dev/null
+++ b/.github/workflows/3-upload-test-reports.yml
@@ -0,0 +1,73 @@
+name: Step 3, Upload test reports
+
+# This step triggers after push to the ci.yml file on the ci branch.
+# This workflow updates from step 3 to step 4.
+
+# This will run every time we push to the ci.yml file on the ci branch.
+# Reference: https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - ci
+ paths:
+ - .github/workflows/ci.yml
+
+# Reference: https://docs.github.com/actions/security-guides/automatic-token-authentication
+permissions:
+ # Need `contents: read` to checkout the repository.
+ # Need `contents: write` to update the step metadata.
+ contents: write
+
+jobs:
+ # Get the current step to only run the main job when the learner is on the same step.
+ get_current_step:
+ name: Check current step number
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: get_step
+ run: |
+ echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
+ outputs:
+ current_step: ${{ steps.get_step.outputs.current_step }}
+
+ on_add_test_reporting:
+ name: On add test reporting
+ needs: get_current_step
+
+ # We will only run this action when:
+ # 1. This repository isn't the template repository.
+ # 2. The step is currently 3.
+ # Reference: https://docs.github.com/actions/learn-github-actions/contexts
+ # Reference: https://docs.github.com/actions/learn-github-actions/expressions
+ if: >-
+ ${{ !github.event.repository.is_template
+ && needs.get_current_step.outputs.current_step == 3 }}
+
+ # We'll run Ubuntu for performance instead of Mac or Windows.
+ runs-on: ubuntu-latest
+
+ steps:
+ # We'll need to check out the repository so that we can edit the README.
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Let's get all the branches.
+
+ # Verify the learner added actions/upload-artifact.
+ - name: Verify workflow
+ uses: skills/action-check-file@v1
+ with:
+ file: .github/workflows/ci.yml
+ search: actions/upload-artifact
+
+ # In README.md, switch step 3 for step 4.
+ - name: Update to step 4
+ uses: skills/action-update-step@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ from_step: 3
+ to_step: 4
+ branch_name: ci
diff --git a/.github/workflows/4-add-branch-protections.yml b/.github/workflows/4-add-branch-protections.yml
new file mode 100644
index 0000000..94327bd
--- /dev/null
+++ b/.github/workflows/4-add-branch-protections.yml
@@ -0,0 +1,73 @@
+name: Step 4, Add branch protections
+
+# This step triggers after we turn on or edit a branch protection rule.
+# This workflow updates from step 4 to step 5.
+
+# This will run every time we turn on or edit a branch protection rule.
+# Reference: https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
+on:
+ workflow_dispatch:
+ branch_protection_rule:
+ types:
+ - created
+ - edited
+
+# Reference: https://docs.github.com/actions/security-guides/automatic-token-authentication
+permissions:
+ # Need `contents: read` to checkout the repository.
+ # Need `contents: write` to update the step metadata.
+ contents: write
+
+jobs:
+ # Get the current step to only run the main job when the learner is on the same step.
+ get_current_step:
+ name: Check current step number
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: get_step
+ run: |
+ echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
+ outputs:
+ current_step: ${{ steps.get_step.outputs.current_step }}
+
+ on_update_branch_protection:
+ name: On update branch protection
+ needs: get_current_step
+
+ # We will only run this action when:
+ # 1. This repository isn't the template repository.
+ # 2. The step is currently 4.
+ # Reference: https://docs.github.com/actions/learn-github-actions/contexts
+ # Reference: https://docs.github.com/actions/learn-github-actions/expressions
+ if: >-
+ ${{ !github.event.repository.is_template
+ && needs.get_current_step.outputs.current_step == 4 }}
+
+ # We'll run Ubuntu for performance instead of Mac or Windows.
+ runs-on: ubuntu-latest
+
+ steps:
+ # We'll need to check out the repository so that we can edit the README.
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Let's get all the branches.
+ ref: ci # Important, as normally `branch_protection_rule` event won't grab other branches
+
+ - name: Merge changes from origin/main into ci
+ run: ./.github/script/merge-branch.sh
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ branch1: origin/main
+ branch2: ci
+
+ # In README.md, switch step 4 for step 5.
+ - name: Update to step 5
+ uses: skills/action-update-step@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ from_step: 4
+ to_step: 5
+ base_branch_name: ci
diff --git a/.github/workflows/5-merge-your-pull-request.yml b/.github/workflows/5-merge-your-pull-request.yml
new file mode 100644
index 0000000..6ed9da2
--- /dev/null
+++ b/.github/workflows/5-merge-your-pull-request.yml
@@ -0,0 +1,65 @@
+name: Step 5, Merge your pull request
+
+# This step triggers after a pull requst is merged to `main`.
+# This workflow updates from step 5 to step X.
+
+# This will run every time we create push a commit to `main`.
+# Reference: https://docs.github.com/actions/learn-github-actions/events-that-trigger-workflows
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+
+# Reference: https://docs.github.com/actions/security-guides/automatic-token-authentication
+permissions:
+ # Need `contents: read` to checkout the repository.
+ # Need `contents: write` to update the step metadata.
+ contents: write
+
+jobs:
+ # Get the current step to only run the main job when the learner is on the same step.
+ get_current_step:
+ name: Check current step number
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - id: get_step
+ run: |
+ echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
+ outputs:
+ current_step: ${{ steps.get_step.outputs.current_step }}
+
+ on_merge:
+ name: On merge
+ needs: get_current_step
+
+ # We will only run this action when:
+ # 1. This repository isn't the template repository.
+ # 2. The step is currently 5.
+ # Reference: https://docs.github.com/actions/learn-github-actions/contexts
+ # Reference: https://docs.github.com/actions/learn-github-actions/expressions
+ if: >-
+ ${{ !github.event.repository.is_template
+ && needs.get_current_step.outputs.current_step == 5 }}
+
+ # We'll run Ubuntu for performance instead of Mac or Windows.
+ runs-on: ubuntu-latest
+
+ steps:
+ # We'll need to check out the repository so that we can edit the README.
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Let's get all the branches.
+
+
+ # In README.md, switch step 5 for step X.
+ - name: Update to step X
+ uses: skills/action-update-step@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ from_step: 5
+ to_step: X
+ base_branch_name: ci
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ee5535f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,43 @@
+# Compiled source #
+###################
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+
+# Course specific #
+###################
+node_modules
+package.json
+package-lock.json
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..6c5bc3d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) GitHub, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0d3ddb4
--- /dev/null
+++ b/README.md
@@ -0,0 +1,75 @@
+
+
+
+
+# Test with Actions
+
+_Create workflows that enable you to use Continuous Integration (CI) for your projects._
+
+
+
+
+
+## Welcome
+
+[Continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) can help you stick to your team’s quality standards by running tests and reporting the results on GitHub. CI tools run builds and tests, triggered by commits. The results post back to GitHub in the pull request. The goal is fewer issues in `main` and faster feedback as you work.
+
+- **Who is this for**: Developers, DevOps Engineers, new GitHub users, students, teams.
+- **What you'll learn**: What continuous integration is, how to use GitHub Actions for CI, how to create a workflow that runs tests and produces test reports.
+- **What you'll build**: We'll use [remark-lint](https://github.com/remarkjs/remark-lint) to check the consistency of Markdown files.
+- **Prerequisites**: We assume you've completed [Hello GitHub Actions](https://github.com/skills/hello-github-actions) first.
+- **How long**: This course takes less than two hours to complete.
+
+In this course, you will:
+
+1. Add a test workflow
+2. Fix the test
+3. Upload a test report
+4. Add branch protections
+5. Merge your pull request
+
+### How to start this course
+
+
+
+[![start-course](https://user-images.githubusercontent.com/1221423/235727646-4a590299-ffe5-480d-8cd5-8194ea184546.svg)](https://github.com/new?template_owner=skills&template_name=test-with-actions&owner=%40me&name=skills-test-with-actions&description=My+clone+repository&visibility=public)
+
+1. Right-click **Start course** and open the link in a new tab.
+2. In the new tab, most of the prompts will automatically fill in for you.
+ - For owner, choose your personal account or an organization to host the repository.
+ - We recommend creating a public repository, as private repositories will [use Actions minutes](https://docs.github.com/billing/managing-billing-for-github-actions/about-billing-for-github-actions).
+ - Scroll down and click the **Create repository** button at the bottom of the form.
+3. After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.
+
+
diff --git a/resume.md b/resume.md
new file mode 100644
index 0000000..45ff2d8
--- /dev/null
+++ b/resume.md
@@ -0,0 +1,28 @@
+# GitHub Teacher
+
+_Charting the knowledge of the Internet, just like Galileo charted the stars._
+
+## Experience
+
+### GitHub Trainer
+
+Teach all things *Git*, give away all the stickers, ensure world peace.
+
+
+
+### Supportocat
+
+Provide _world class support_ to customers on the GitHub platform
+
+## Skills
+
+### Education
+
+Developed and maintained various conference talks, online training, and in-person trainings covering various topics including Git, GitHub, and Open Source.
+
+### Leadership
+
+Managed multiple _asynchronous teams_ in the development, maintenance, and release of various web applications and websites.