Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ template:
repo: using-github-actions-for-ci-template
name: github-actions-for-ci
before:
# 1. Bot creates [Tic tac toe game](https://github.com/githubtraining/actions-template) for the learner, protects master branch
# 1. Bot creates [Tic tac toe game](https://github.com/githubtraining/actions-template) for the learner, protects main branch
# 1. Bot opens a bug report explaining the app is broken, asks learner to figure out what's wrong by adding some testing.
- type: updateBranchProtection
- type: createIssue
Expand All @@ -32,7 +32,7 @@ before:

steps:
# Step 1
# 1. Learner opens a PR with a new workflow by using the [templated workflow for Node](https://github.com/actions/starter-workflows/blob/master/ci/node.js.yml)
# 1. Learner opens a PR with a new workflow by using the [templated workflow for Node](https://github.com/actions/starter-workflows/blob/main/ci/node.js.yml)
# 1. Bot leaves line-specific comments explaining the pieces that were just added from the templated workflow.
- title: Use a templated workflow
description: Create a pull request with a templated workflow
Expand Down Expand Up @@ -88,7 +88,7 @@ steps:

# Step 2
# 1. GitHub sends us a workflow run.
# 1. Bot explains what is happening, and why the page build failed (we don't have a [test script](https://github.com/githubtraining/actions-template/blob/master/package.json#L10))
# 1. Bot explains what is happening, and why the page build failed (we don't have a [test script](https://github.com/githubtraining/actions-template/blob/main/package.json#L10))
- title: Run a templated workflow
description: Wait for GitHub to run the templated workflow and report back the results
event: check_suite.completed
Expand Down Expand Up @@ -216,7 +216,7 @@ steps:
body: 06_custom-workflow.md
action_id: newIssue
data:
workflowUrl: "%payload.repository.html_url%/edit/master/.github/workflows/node.js.yml"
workflowUrl: "%payload.repository.html_url%/edit/main/.github/workflows/node.js.yml"
store:
workflow_issue_url: "{{ result.data.html_url }}"
- type: respond
Expand All @@ -225,7 +225,7 @@ steps:
url: "%actions.newIssue.data.html_url%"

# Step 7
# 1. Learner edits the first workflow changing from templated [Node v8,10,12 to just v8,10](https://github.com/githubtraining/actions-template/blob/master/.github/workflows/node.js.yml#L10).
# 1. Learner edits the first workflow changing from templated [Node v8,10,12 to just v8,10](https://github.com/githubtraining/actions-template/blob/main/.github/workflows/node.js.yml#L10).
# 1. Bot asks learner to add a build for Windows
- title: Create a custom GitHub Actions workflow
description: Edit the existing workflow with new build targets
Expand Down Expand Up @@ -271,7 +271,7 @@ steps:
node_version_pr: "{{ payload.pull_request.html_url }}"

# Step 8
# 1. Learner adds Windows to the [matrix os](https://github.com/githubtraining/actions-template/blob/master/.github/workflows/node.js.yml#L9)
# 1. Learner adds Windows to the [matrix os](https://github.com/githubtraining/actions-template/blob/main/.github/workflows/node.js.yml#L9)
# 1. Bot asks learner to add a new job for testing, and separate out the test script into that new job.
- title: Target a Windows environment
description: Edit your workflow file to build for Windows environments
Expand Down Expand Up @@ -407,7 +407,7 @@ steps:
operator: ===
right: Improve CI
- type: mergeBranch
head: master
head: main
base: team-workflow
- type: createPullRequest
title: A custom workflow
Expand Down Expand Up @@ -516,7 +516,7 @@ steps:
- type: removeBranchProtection
- type: requestReviewFromRegistrant
- type: respond
with: 17_protect-master.md
with: 17_protect-main.md
Comment thread
lmkeston marked this conversation as resolved.
data:
settingsUrl: "%payload.repository.html_url%/settings"
approvalUrl: "%payload.pull_request.html_url%/files#submit-review"
Expand All @@ -529,7 +529,7 @@ steps:
# 1. Bot merges PR.
# 1. Bot turns on pages build, drops link in the PR, explains to the learner the value on a workflow that enforces team behaviors.
- title: Use branch protections
description: Complete the automated review process by protecting the master branch
description: Complete the automated review process by protecting the main branch
link: "{{ store.workflow_pr_url }}"
event:
- pull_request_review.submitted
Expand All @@ -548,7 +548,7 @@ steps:
method: repos.getBranch
owner: "%payload.repository.owner.login%"
repo: "%payload.repository.name%"
branch: master
branch: main
action_id: branchProtection
- type: gate
left: "%actions.branchProtection.data.protected%"
Expand Down
2 changes: 1 addition & 1 deletion responses/06_custom-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Our fictional team has a custom workflow that goes beyond the template we've use
**Access to build artifacts** so that we can deploy them to a target environment

<img alt="icon of a security shield indicating branch protections" align="left" width="50" height="50" src="https://user-images.githubusercontent.com/6351798/88609465-6a1da200-d041-11ea-9c4c-55ffe90a3e72.png"><br/>
**Branch protections** so that the `master` branch can't be deleted or inadvertently broken
**Branch protections** so that the `main` branch can't be deleted or inadvertently broken

<img alt="icon of a review approval" align="left" width="50" height="50" src="https://user-images.githubusercontent.com/6351798/88609558-9df8c780-d041-11ea-906f-dd23efd9f65c.png"><br/>
**Required reviews** so that any pull requests are double checked by teammates
Expand Down
2 changes: 1 addition & 1 deletion responses/10_use-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _You can follow the manual steps below, or accept the suggestion in the followin
run: |
npm install
npm run build
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/upload-artifact@main
- uses: actions/upload-artifact@v2

with:
name: webpack artifacts
path: public/
Expand Down
4 changes: 2 additions & 2 deletions responses/11_download-suggestion.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
You can commit this suggestion directly.

```suggestion
- uses: actions/download-artifact@master
- uses: actions/download-artifact@main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/download-artifact@main
- uses: actions/download-artifact@v2

with:
name: webpack artifacts
path: public
- name: npm install, and test
```
```
2 changes: 1 addition & 1 deletion responses/11_use-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _You can follow the manual steps below, or accept the suggestions in the followi
...
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@master
- uses: actions/download-artifact@main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: actions/download-artifact@main
- uses: actions/download-artifact@v2

with:
name: webpack artifacts
path: public
Expand Down
4 changes: 2 additions & 2 deletions responses/12_merge-improved-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Our custom workflow now accounts for:
----

In the next few steps, we'll finish supporting our team's workflow:
- **branch protections** so that the `master` branch can't be deleted or inadvertently broken
- **branch protections** so that the `main` branch can't be deleted or inadvertently broken
- **required reviews** so that any pull requests are double checked by teammates
- **obvious approvals** so we can merge quickly and potentially automate merges and deployments

I'll respond when you merge this pull request.
I'll respond when you merge this pull request.
4 changes: 2 additions & 2 deletions responses/13_partial-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Remember the [custom workflow]({{ workflowIssue }}) we are attempting to create
- :white_check_mark: **test against multiple targets** so that we know if our supported operating systems and Node.js versions are working
- :white_check_mark: **dedicated test job** so that we can separate out build from test details
- :white_check_mark: **access to build artifacts** so that we can deploy them to a target environment
- **branch protections** so that the `master` branch can't be deleted or inadvertently broken
- **branch protections** so that the `main` branch can't be deleted or inadvertently broken
- **required reviews** so that any pull requests are double checked by teammates
- **obvious approvals** so we can merge quickly and potentially automate merges and deployments

Expand All @@ -23,4 +23,4 @@ GitHub Actions can run multiple workflows for different event triggers. Let's cr
name: Team awesome's approval workflow
```

I'll respond when you commit to this branch.
I'll respond when you commit to this branch.
6 changes: 3 additions & 3 deletions responses/17_add-step-suggestion.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
### Step 17: Hint

1. Edit the [workflow file]({{ editUrl }}) on this branch.
1. Give your step a name, have it use `pullreminders/label-when-approved-action@master`, and set all the required environment variables.
1. Give your step a name, have it use `pullreminders/label-when-approved-action@main`, and set all the required environment variables.
```suggestion
runs-on: ubuntu-latest
steps:
- name: Label when approved
uses: pullreminders/label-when-approved-action@master
uses: pullreminders/label-when-approved-action@main
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: pullreminders/label-when-approved-action@main
uses: pullreminders/label-when-approved-action@1.0.7

env:
APPROVALS: "1"
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
ADD_LABEL: "approved"
```
1. Commit your changes to this branch.
1. Commit your changes to this branch.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Awesome! We can now check an additional requirement off our list!
- :white_check_mark: **dedicated test job** so that we can separate out build from test details
- :white_check_mark: **access to build artifacts** so that we can deploy them to a target environment
- :white_check_mark: **obvious approvals** so we can merge quickly and potentially automate merges and deployments
- **branch protections** so that the `master` branch can't be deleted or inadvertently broken
- **branch protections** so that the `main` branch can't be deleted or inadvertently broken
- **required reviews** so that any pull requests are double checked by teammates

We'll now use branch protections in combination with this change so that everything goes smoothly. Up until now, I've handled branch protections for you, but I've removed them so that you can learn how to set them.
Expand All @@ -21,11 +21,11 @@ Protected branches ensure that collaborators on your repository cannot make irre

Next, add branch protections and continue with the course.

### :keyboard: Activity: Complete the automated review process by protecting the master branch
### :keyboard: Activity: Complete the automated review process by protecting the main branch

1. Go to [**Branches**]({{ settingsUrl}}/branches) settings. You can navigate to that page manually by clicking on the right-most tab in the top of the repository called **Settings** and then clicking on **Branches**.
2. Click on [**Add rule**]({{ settingsUrl }}/branch_protection_rules/new) under "Branch protection rules".
3. Type `master` in **Branch name pattern**.
3. Type `main` in **Branch name pattern**.
4. Check **Require pull request reviews before merging**.
5. Check **Require status checks to pass before merging**.
6. Check all build and test jobs that you'd like to see in the newly visible gray box.
Expand Down
2 changes: 1 addition & 1 deletion responses/18_congratulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Nice work, you did it! Your workflows now contain:
- :white_check_mark: **test against multiple targets** so that we know if our supported operating systems and Node.js versions are working
- :white_check_mark: **dedicated test job** so that we can separate out build from test details
- :white_check_mark: **access to build artifacts** so that we can deploy them to a target environment
- :white_check_mark: **branch protections** so that the `master` branch can't be deleted or inadvertently broken
- :white_check_mark: **branch protections** so that the `main` branch can't be deleted or inadvertently broken
- :white_check_mark: **required reviews** so that any pull requests are double checked by teammates
- :white_check_mark: **obvious approvals** so we can merge quickly and potentially automate merges and deployments

Expand Down