Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Use PR reviews #6

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
40 changes: 20 additions & 20 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ tags:

before:
- type: updateBranchProtection
store:
repoUrl: '%payload.repository.html_url%'
actionsUrl: '%payload.repository.html_url%/actions'
- type: createLabel
name: first-cat-fact
color: FFBD33
Expand All @@ -37,45 +40,46 @@ before:
- type: createIssue
title: Start here!
body: 01_welcome-issue.md
store:
firstIssueUrl: '%result.data.html_url%'
action_id: welcomeIssue
- type: respond
issue: '%actions.welcomeIssue.data.number%'
with: 01_welcome-activity.md
data:
quicklink: '%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml&workflow_template=blank'
actionsUrl: '%payload.repository.html_url%/actions/new'
quicklink: '%store.repo_url%/new/master?filename=.github/workflows/my-workflow.yml&workflow_template=blank'
steps:
- title: Setup a workflow file
description: Create a pull request to add a workflow
event:
- pull_request.opened
- pull_request.edited
link: '{{ repoUrl }}/issues/1'
link: '{{ store.firstIssueUrl }}'
actions:
# if the pull request title equals 'Create my first workflow'
- type: gate
left: '%payload.pull_request.title%'
operator: ===
right: Create my first workflow

# if those statments FAIL... do this
else:
- type: respond
with: e-rename-pr.md
data:
title: Create my first workflow
# if those gates === true Then do this stuff
- type: closeIssue
issue: Start here!
store:
firstPrUrl: '%payload.pull_request.html_url%'
firstPrHead: '%payload.pull_request.head.ref%'
- type: respond
issue: Start here!
with: new-pull-request.md
data:
pullUrl: '%payload.pull_request.html_url%'
- type: closeIssue
issue: Start here!
pullUrl: '%store.firstPrUrl%'
- type: respond
with: 01_explain-workflow.md
data:
actionsUrl: '%payload.repository.html_url%/actions'
- type: respond
with: 01_explain-environment.md
- type: respond
Expand All @@ -86,12 +90,12 @@ steps:
with: 02_modify-workflow.md
issue: Create my first workflow
data:
workflowFile: '%payload.repository.html_url%/edit/%payload.pull_request.head.ref%/.github/workflows/my-workflow.yml'
workflowFile: '%store.repoUrl%/edit/%store.firstPrHead%/.github/workflows/my-workflow.yml'

- title: Edit the current workflow
description: Remove boilerplate steps from `my-workflow.yml`
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/2'
link: '{{ store.firstPrUrl }}'
actions:
- type: gate
left: '%payload.pull_request.title%'
Expand All @@ -102,18 +106,15 @@ steps:
with: e-generic.md
data:
expected: a commit to a pull request titled **Create my first workflow**
- type: getPullRequest
pullRequest: Create my first workflow
action_id: workflowPr
- type: respond
with: 03_reference-actions.md
data:
workflowFile: '%payload.repository.html_url%/edit/%actions.workflowPr.data.head.ref%/.github/workflows/my-workflow.yml'
workflowFile: '%store.repoUrl%/edit/%store.firstPrHead%/.github/workflows/my-workflow.yml'

- title: Add an action reference to the workflow
description: Reference our custom action from `my-workflow.yml`
event: pull_request.synchronize
link: '{{ repoUrl }}/pull/2'
link: '{{ store.firstPrUrl }}'
actions:
- type: gate
left: '%payload.pull_request.title%'
Expand All @@ -128,18 +129,17 @@ steps:
title: Your first Docker based action
body: docker-overview.md
action_id: dockerOverview
store:
firstDockerIssueUrl: '%result.data.html_url%'
data:
actionsUrl: '%payload.repository.html_url%/actions/new'
quicklink: '%payload.repository.html_url%/new/master?filename=.github/actions/hello-world/action.yml'
quicklink: '%store.repoUrl%/new/master?filename=.github/actions/hello-world/action.yml'
comments:
- 05_explain-actions.md
- 05_explain-metadata.md
- 05_create-metadata.md
- type: createReview
event: APPROVE
body: 04_on-to-actions.md
data:
issueUrl: '%actions.dockerOverview.data.html_url%'
pullRequest: Create my first workflow
- type: mergePullRequest

Expand Down
2 changes: 1 addition & 1 deletion responses/01_explain-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Great job adding the workflow. Adding that file to this branch is enough for GitHub Actions to begin running on your repository. The time this takes will vary based on the complexity of the workflow. At this point we can ignore the workflow because it doesn't do anything yet, but while this runs I'll briefly explain the components of the workflow you just added.

If you want to inspect your running workflow you can do so by heading over to the [Actions tab]({{actionsUrl}}) of this repository.
If you want to inspect your running workflow you can do so by heading over to the [Actions tab]({{ store.actionsUrl }}) of this repository.
2 changes: 1 addition & 1 deletion responses/01_welcome-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### :keyboard: Activity: Create a pull request to add a workflow

1. Create a new workflow file titled `my-workflow.yml` by using the instructions below, or [this quicklink]({{quicklink}}).
- Go to the [Actions tab]({{ actionsUrl }}).
- Go to the [Actions tab]({{ store.actionsUrl }}/new).
- Choose the **Set up a workflow yourself** option, located on the top right hand corner of the screen.
- Change the name of the file from `main.yml` to `my-workflow.yml`.
1. Commit the workflow to a new branch named `add-initial-workflow`.
Expand Down
2 changes: 1 addition & 1 deletion responses/04_on-to-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Your workflow is now set up to execute two actions when any `push` event happens

For now, this workflow will fail. It fails because we have not yet created the `hello-world` action, so this is expected.

Head [over here]({{issueUrl}}) to get started in creating the `hello-world` action!
Head [over here]({{store.firstDockerIssueUrl}}) to get started in creating the `hello-world` action!
2 changes: 1 addition & 1 deletion responses/05_explain-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ _Although the **workflow** file is used to allow us to set the `inputs` and `out

**The failing workflow**

You may be following along on the [Actions tab]({{actionsUrl}}) of this repository. If you are, you'll notice that the workflow we set up previously is failing. That is the currently expected behavior: we referenced an action in the `hello-world` directory, which doesn't yet exist. We will be fixing that as we move forward with the lesson.
You may be following along on the [Actions tab]({{store.actionsUrl}}) of this repository. If you are, you'll notice that the workflow we set up previously is failing. That is the currently expected behavior: we referenced an action in the `hello-world` directory, which doesn't yet exist. We will be fixing that as we move forward with the lesson.