diff --git a/config.yml b/config.yml index c8a7b74..be82e8d 100644 --- a/config.yml +++ b/config.yml @@ -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 @@ -37,27 +40,27 @@ 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 @@ -65,17 +68,18 @@ 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 - data: - actionsUrl: '%payload.repository.html_url%/actions' - type: respond with: 01_explain-environment.md - type: respond @@ -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%' @@ -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%' @@ -128,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 @@ -138,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/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. diff --git a/responses/01_welcome-activity.md b/responses/01_welcome-activity.md index b63a32c..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 }}). + - 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`. 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.