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

Commit bbf6866

Browse files
authored
Merge pull request #6 from githubtraining/troubleshoot-action
Help learner when workflows don't run
2 parents 3396a67 + c85b02c commit bbf6866

File tree

4 files changed

+43
-6
lines changed

4 files changed

+43
-6
lines changed

config.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ template:
1515
# Repo artifacts
1616
# repositoryUrl
1717
# actionsUrl
18+
# workflowEditUrl
19+
# branchSettingsUrl
1820
# 1. (Issue) Start here!
1921
# welcomeIssueUrl
2022
# welcomeIssueNumber
@@ -42,6 +44,8 @@ before:
4244
store:
4345
repositoryUrl: '{{ payload.repository.html_url }}'
4446
actionsUrl: '{{ payload.repository.html_url }}/actions'
47+
workflowEditUrl: '{{ payload.repository.html_url }}/edit/master/.github/workflows/my-workflow.yml'
48+
branchSettingsUrl: '{{ payload.repository.html_url }}/settings/branches'
4549
- type: createProjectBoard
4650
name: Learning Lab Project Board
4751
description: >-
@@ -131,7 +135,7 @@ steps:
131135
- type: respond
132136
with: e-generic.md
133137
data:
134-
expected: merge pull request '{{ store.firstPullNumber }}'
138+
expected: 'merge pull request #{{ store.firstPullNumber }}'
135139
- type: createIssue
136140
title: Create an issue comment with GitHub Script
137141
body: 02_workflow-triggered.md
@@ -249,7 +253,7 @@ steps:
249253
- type: respond
250254
with: e-generic.md
251255
data:
252-
expected: merge pull request '{{ store.secondPullNumber }}'
256+
expected: 'merge pull request #{{ store.secondPullNumber }}'
253257
- type: createIssue
254258
title: Comment and triage with GitHub Script
255259
body: 05_workflow-triggered.md
@@ -348,7 +352,7 @@ steps:
348352
- type: respond
349353
with: e-generic.md
350354
data:
351-
expected: push a commit to '{{ store.thirdPullNumber }}'
355+
expected: 'push a commit to #{{ store.thirdPullNumber }}'
352356
- type: createReview
353357
body: 08_merge-workflow.md
354358
event: APPROVE
@@ -369,7 +373,7 @@ steps:
369373
- type: respond
370374
with: e-generic.md
371375
data:
372-
expected: merge pull request '{{ store.thirdPullNumber }}'
376+
expected: 'merge pull request #{{ store.thirdPullNumber }}'
373377
- type: octokit
374378
action_id: triggerIssue
375379
method: issues.create
@@ -381,6 +385,17 @@ steps:
381385
382386
Like before, now we have to wait for the workflow to run so that we can see the results.
383387
388+
<details>
389+
<summary>Workflow not running? Click here for some troubleshooting.</summary>
390+
391+
Try the following troubleshooting steps:
392+
1. Click on the [Actions tab]({{ store.actionsUrl }}) to see the status of your workflow run. See [Managing a workflow run](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run) on GitHub Help for more information.
393+
1. Edit your [workflow file]( {{ store.workflowEditUrl }}) and look for errors in the linter built into the browser.
394+
1. Look for the [workflow trigger](https://help.github.com/en/actions/reference/events-that-trigger-workflows) and ensure you are performing an action that triggers that workflow.
395+
396+
If you need to make changes to your code, remove the [master branch protection]({{ store.branchSettingsUrl }}) and merge your changes into the `master` branch.
397+
</details>
398+
384399
---
385400
386401
I'll respond here once it has completed!

responses/00_explain-gh-script.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Okay, that doesn't seem so hard. Now that we know how to do it with Octokit let'
2020
```yaml
2121
- uses: actions/github-script@0.8.0
2222
with:
23-
github-token: ${{secrets.GITHUB_TOKEN}}
23+
github-token: {% raw %}${{secrets.GITHUB_TOKEN}}{% endraw %}
2424
script: |
2525
github.issues.createComment({
2626
issue_number: context.issue.number,
@@ -51,7 +51,7 @@ Again, that's not too hard at all. Now let's do the same thing, only using the G
5151
```yml
5252
- uses: actions/github-script@0.8.0
5353
with:
54-
github-token: ${{secrets.GITHUB_TOKEN}}
54+
github-token: {% raw %}${{secrets.GITHUB_TOKEN}}{% endraw %}
5555
script: |
5656
github.pull.create({
5757
repo: github.context.repo.repo,

responses/02_workflow-triggered.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ This means that every time an issue gets opened in this repository the GitHub Sc
1414
1515
You should expect to see the result right here in this issue!
1616
17+
<details>
18+
<summary>Workflow not running? Click here for some troubleshooting.</summary>
19+
20+
Try the following troubleshooting steps:
21+
1. Click on the [Actions tab]({{ store.actionsUrl }}) to see the status of your workflow run. See [Managing a workflow run](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run) on GitHub Help for more information.
22+
1. Edit your [workflow file]( {{ store.workflowEditUrl }}) and look for errors in the linter built into the browser.
23+
1. Look for the [workflow trigger](https://help.github.com/en/actions/reference/events-that-trigger-workflows) and ensure you are performing an action that triggers that workflow.
24+
25+
If you need to make changes to your code, remove the [master branch protection]({{ store.branchSettingsUrl }}) and merge your changes into the `master` branch.
26+
</details>
27+
1728
---
1829

1930
I'll respond in this issue after your workflow runs!

responses/05_workflow-triggered.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
Now that your updates have been merged and we've triggered the workflow we should see our workflow begin helping us automate the triage of new issues.
44

5+
<details>
6+
<summary>Workflow not running? Click here for some troubleshooting.</summary>
7+
8+
Try the following troubleshooting steps:
9+
1. Click on the [Actions tab]({{ store.actionsUrl }}) to see the status of your workflow run. See [Managing a workflow run](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run) on GitHub Help for more information.
10+
1. Edit your [workflow file]( {{ store.workflowEditUrl }}) and look for errors in the linter built into the browser.
11+
1. Look for the [workflow trigger](https://help.github.com/en/actions/reference/events-that-trigger-workflows) and ensure you are performing an action that triggers that workflow.
12+
13+
If you need to make changes to your code, remove the [master branch protection]({{ store.branchSettingsUrl }}) and merge your changes into the `master` branch.
14+
</details>
15+
516
---
617

718
I'll respond once your workflow has completed!

0 commit comments

Comments
 (0)