Skip to content

Commit

Permalink
Activate action update step (#53)
Browse files Browse the repository at this point in the history
* Clean up the mess made in #51

Resolve stylistic errors in the step markdown files

* Activate `action-update-step` in Steps 4 and 5

Uncomment the steps

* Change instructions corresponding to workflows

Tell learners to follow instructions on `ci`

* Insert "and" before "then"

* Refer to the merge conflicts

TODO: figure out a better way

* Resolve the **Review required** merge block

You don't want to bypass branch protections
  • Loading branch information
sinsukehlab authored Dec 8, 2023
1 parent c83a48c commit cce1a50
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/steps/1-add-a-test-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _Welcome to "GitHub Actions: Continuous Integration"! :wave:_

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. This workflow has a deliberate error in it ("npx" should be "npm"), which we'll debug in the next unit.
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

Expand All @@ -42,4 +42,4 @@ First, let's add a workflow to *lint* (clean, like a lint roller) our Markdown f
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 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.
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.
2 changes: 1 addition & 1 deletion .github/steps/3-upload-test-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ To upload artifacts to the artifact storage, we can use an action built by GitHu
```
1. Commit your change to this branch.
1. Wait about 20 seconds 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.
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.
5 changes: 2 additions & 3 deletions .github/steps/4-add-branch-protections.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ Protected branches ensure that collaborators on your repository cannot make irre
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 **Save changes**.
1. _Once you turn on branch protection, Actions can no longer push directly to `main`. You'll need to open the next step on your own._

<!-- Wait about 20 seconds 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. -->
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._
10 changes: 3 additions & 7 deletions .github/steps/5-merge-your-pull-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ You can now [merge](https://docs.github.com/get-started/quickstart/github-glossa

### :keyboard: Activity: Merge your pull request

1. Go to the **Pull requests** tab.
1. Resolve any merge conflicts. <!-- TODO: figure out a better way to deal with the merge conflicts. -->
1. Click **Merge pull request**.
1. Delete the branch `ci` (optional).
1. _Once you turn on branch protection, Actions can no longer push directly to `main`. You'll need to open the "finish" on your own._
1. Navigate to the `.github` directory.
1. Select the `steps` directory.
1. Open the `X-finish.md` file.

<!-- Wait about 20 seconds 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. -->
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.
16 changes: 8 additions & 8 deletions .github/workflows/4-add-branch-protections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ jobs:
ref: ci # Important, as normally `branch_protection_rule` event won't grab other branches


# TODO: figure out a better way to deal with the lock on `main`, merge conflict this creates
# TODO: figure out a better way to deal with the merge conflict.
# 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
# branch_name: ci
- 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
15 changes: 7 additions & 8 deletions .github/workflows/5-merge-your-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ jobs:
fetch-depth: 0 # Let's get all the branches.


# TODO: figure out a better way to deal with the lock on `main`
# 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
# branch_name: ci
- 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

0 comments on commit cce1a50

Please sign in to comment.