From 65a7605fe241d3f615770df03db400db6ba2b069 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 17:28:08 -0400 Subject: [PATCH 01/11] use the store for the actionsUrl --- config.yml | 3 ++- responses/01_welcome-activity.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index c8a7b74..91c958c 100644 --- a/config.yml +++ b/config.yml @@ -41,9 +41,10 @@ before: - type: respond issue: '%actions.welcomeIssue.data.number%' with: 01_welcome-activity.md + store: + actionsUrl: '%payload.repository.html_url%/actions%' data: quicklink: '%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml&workflow_template=blank' - actionsUrl: '%payload.repository.html_url%/actions/new' steps: - title: Setup a workflow file description: Create a pull request to add a workflow diff --git a/responses/01_welcome-activity.md b/responses/01_welcome-activity.md index b63a32c..5950f93 100644 --- a/responses/01_welcome-activity.md +++ b/responses/01_welcome-activity.md @@ -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]({{ 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`. From 6a7bc8fa102ae50b57d732a264e86678dbbf514a Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 17:30:13 -0400 Subject: [PATCH 02/11] properly ref the store --- responses/01_welcome-activity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responses/01_welcome-activity.md b/responses/01_welcome-activity.md index 5950f93..381c859 100644 --- a/responses/01_welcome-activity.md +++ b/responses/01_welcome-activity.md @@ -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 }}/new). + - 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`. From ee85989fb98b72d619179ce772aa8b2fba98900e Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 17:32:37 -0400 Subject: [PATCH 03/11] remove extra % --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 91c958c..4047aee 100644 --- a/config.yml +++ b/config.yml @@ -42,7 +42,7 @@ before: issue: '%actions.welcomeIssue.data.number%' with: 01_welcome-activity.md store: - actionsUrl: '%payload.repository.html_url%/actions%' + actionsUrl: '%payload.repository.html_url%/actions' data: quicklink: '%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml&workflow_template=blank' steps: From 0eb6394445530761350d07b9bb6615fefef4c979 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 17:38:48 -0400 Subject: [PATCH 04/11] use store in registration --- responses/01_welcome-activity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responses/01_welcome-activity.md b/responses/01_welcome-activity.md index 381c859..1f0148e 100644 --- a/responses/01_welcome-activity.md +++ b/responses/01_welcome-activity.md @@ -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]({{ store.actionsUrl }}/new). + - Go to the [Actions tab]({{ registration.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`. From 90f0b06fcfdc91c406b83de00405defc74deaf42 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 17:43:59 -0400 Subject: [PATCH 05/11] go back to not using registration.store --- responses/01_welcome-activity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responses/01_welcome-activity.md b/responses/01_welcome-activity.md index 1f0148e..381c859 100644 --- a/responses/01_welcome-activity.md +++ b/responses/01_welcome-activity.md @@ -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]({{ registration.store.actionsUrl }}/new). + - 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`. From 919702a1ae84b0904b786e31d068dafa8a350c75 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 17:48:21 -0400 Subject: [PATCH 06/11] move up the store --- config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 4047aee..85386c2 100644 --- a/config.yml +++ b/config.yml @@ -25,6 +25,8 @@ tags: before: - type: updateBranchProtection + store: + actionsUrl: '%payload.repository.html_url%/actions' - type: createLabel name: first-cat-fact color: FFBD33 @@ -41,8 +43,6 @@ before: - type: respond issue: '%actions.welcomeIssue.data.number%' with: 01_welcome-activity.md - store: - actionsUrl: '%payload.repository.html_url%/actions' data: quicklink: '%payload.repository.html_url%/new/master?filename=.github/workflows/my-workflow.yml&workflow_template=blank' steps: From 598d88db16c4019fd7feb52db5b70a781baf26d1 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 18:01:30 -0400 Subject: [PATCH 07/11] use store in a few more places --- config.yml | 11 ++++++----- responses/01_explain-workflow.md | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 85386c2..2c2088d 100644 --- a/config.yml +++ b/config.yml @@ -26,6 +26,7 @@ tags: before: - type: updateBranchProtection store: + repoUrl: '%payload.repository.html_url%' actionsUrl: '%payload.repository.html_url%/actions' - type: createLabel name: first-cat-fact @@ -39,19 +40,21 @@ before: - type: createIssue title: Start here! body: 01_welcome-issue.md + store: + firstIssueUrl: '%payload.issue.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' + 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 @@ -75,8 +78,6 @@ steps: issue: Start here! - type: respond with: 01_explain-workflow.md - data: - actionsUrl: '%payload.repository.html_url%/actions' - type: respond with: 01_explain-environment.md - type: respond @@ -87,7 +88,7 @@ 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/%payload.pull_request.head.ref%/.github/workflows/my-workflow.yml' - title: Edit the current workflow description: Remove boilerplate steps from `my-workflow.yml` diff --git a/responses/01_explain-workflow.md b/responses/01_explain-workflow.md index 004b7c5..9de88a6 100644 --- a/responses/01_explain-workflow.md +++ b/responses/01_explain-workflow.md @@ -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. From 8b363be168465a6f0c0a8772be577d9dd9b42cac Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 18:03:06 -0400 Subject: [PATCH 08/11] use a result instead of action_id --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 2c2088d..4ac3194 100644 --- a/config.yml +++ b/config.yml @@ -41,7 +41,7 @@ before: title: Start here! body: 01_welcome-issue.md store: - firstIssueUrl: '%payload.issue.html_url%' + firstIssueUrl: '%result.issue.html_url%' action_id: welcomeIssue - type: respond issue: '%actions.welcomeIssue.data.number%' From 5218ff9def8e818ccd5f3468489afdd188d84b32 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 18:04:26 -0400 Subject: [PATCH 09/11] use the issue's data object --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 4ac3194..6cf3b0a 100644 --- a/config.yml +++ b/config.yml @@ -41,7 +41,7 @@ before: title: Start here! body: 01_welcome-issue.md store: - firstIssueUrl: '%result.issue.html_url%' + firstIssueUrl: '%result.data.issue.html_url%' action_id: welcomeIssue - type: respond issue: '%actions.welcomeIssue.data.number%' From 0cf54a36be77093006f0c601303de2a9ce7c2484 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 18:10:58 -0400 Subject: [PATCH 10/11] don't use within --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 6cf3b0a..db827cd 100644 --- a/config.yml +++ b/config.yml @@ -41,7 +41,7 @@ before: title: Start here! body: 01_welcome-issue.md store: - firstIssueUrl: '%result.data.issue.html_url%' + firstIssueUrl: '%result.data.html_url%' action_id: welcomeIssue - type: respond issue: '%actions.welcomeIssue.data.number%' From eb07e1a85a0007797122e97edf7317a4c3c173ce Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 26 Mar 2020 18:19:04 -0400 Subject: [PATCH 11/11] use store im moar places --- config.yml | 28 +++++++++++++--------------- responses/04_on-to-actions.md | 2 +- responses/05_explain-actions.md | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/config.yml b/config.yml index db827cd..be82e8d 100644 --- a/config.yml +++ b/config.yml @@ -61,7 +61,6 @@ steps: left: '%payload.pull_request.title%' operator: === right: Create my first workflow - # if those statments FAIL... do this else: - type: respond @@ -69,13 +68,16 @@ steps: 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 - type: respond @@ -88,12 +90,12 @@ steps: with: 02_modify-workflow.md issue: Create my first workflow data: - workflowFile: '%store.repoUrl%/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%' @@ -104,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%' @@ -130,9 +129,10 @@ 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 @@ -140,8 +140,6 @@ steps: - type: createReview event: APPROVE body: 04_on-to-actions.md - data: - issueUrl: '%actions.dockerOverview.data.html_url%' pullRequest: Create my first workflow - type: mergePullRequest diff --git a/responses/04_on-to-actions.md b/responses/04_on-to-actions.md index 14db4ed..401d9f9 100644 --- a/responses/04_on-to-actions.md +++ b/responses/04_on-to-actions.md @@ -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! \ No newline at end of file +Head [over here]({{store.firstDockerIssueUrl}}) to get started in creating the `hello-world` action! \ No newline at end of file diff --git a/responses/05_explain-actions.md b/responses/05_explain-actions.md index 5f83fe5..63b53ec 100644 --- a/responses/05_explain-actions.md +++ b/responses/05_explain-actions.md @@ -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.