Skip to content

Commit 7dc2e3c

Browse files
authored
Updates to match template (skills#12)
* Updates to match template * Add or update get current step jobs * Update job conditional to include current step * Update README.md * Update README.md
1 parent 682cbdd commit 7dc2e3c

File tree

5 files changed

+70
-9
lines changed

5 files changed

+70
-9
lines changed

.github/workflows/0-start.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,29 @@ permissions:
2121
pull-requests: write
2222

2323
jobs:
24+
get_current_step:
25+
name: Check current step number
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
- id: get_step
31+
run: |
32+
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
33+
outputs:
34+
current_step: ${{ steps.get_step.outputs.current_step }}
35+
2436
on_start:
2537
name: On start
2638

2739
# We will only run this action when:
2840
# 1. This repository isn't the template repository
41+
# 2. The STEP is currently 0
2942
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
3043
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
31-
if: ${{ !github.event.repository.is_template }}
44+
if: >-
45+
${{ !github.event.repository.is_template
46+
&& needs.get_current_step.outputs.current_step == 0 }}
3247
3348
# We'll run Ubuntu for performance instead of Mac or Windows
3449
runs-on: ubuntu-latest

.github/workflows/1-resolve-a-merge-conflict.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,29 @@ permissions:
2020
contents: write
2121

2222
jobs:
23+
get_current_step:
24+
name: Check current step number
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- id: get_step
30+
run: |
31+
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
32+
outputs:
33+
current_step: ${{ steps.get_step.outputs.current_step }}
34+
2335
on_resolve_merge_conflict:
2436
name: On resolve merge conflict
2537

2638
# We will only run this action when:
2739
# 1. This repository isn't the template repository
40+
# 2. The STEP is currently 1
2841
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
2942
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
30-
if: ${{ !github.event.repository.is_template }}
43+
if: >-
44+
${{ !github.event.repository.is_template
45+
&& needs.get_current_step.outputs.current_step == 1 }}
3146
3247
# We'll run Ubuntu for performance instead of Mac or Windows
3348
runs-on: ubuntu-latest

.github/workflows/2-create-your-own-conflict.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,29 @@ permissions:
2121
contents: write
2222

2323
jobs:
24+
get_current_step:
25+
name: Check current step number
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
- id: get_step
31+
run: |
32+
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
33+
outputs:
34+
current_step: ${{ steps.get_step.outputs.current_step }}
35+
2436
on_create_references_md:
2537
name: On create references.md
2638

2739
# We will only run this action when:
2840
# 1. This repository isn't the template repository
41+
# 2. The STEP is currently 2
2942
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
3043
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
31-
if: ${{ !github.event.repository.is_template }}
44+
if: >-
45+
${{ !github.event.repository.is_template
46+
&& needs.get_current_step.outputs.current_step == 2 }}
3247
3348
# We'll run Ubuntu for performance instead of Mac or Windows
3449
runs-on: ubuntu-latest

.github/workflows/3-merge-your-pull-request.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,29 @@ permissions:
1919
contents: write
2020

2121
jobs:
22+
get_current_step:
23+
name: Check current step number
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
- id: get_step
29+
run: |
30+
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
31+
outputs:
32+
current_step: ${{ steps.get_step.outputs.current_step }}
33+
2234
on_merge:
2335
name: On merge
2436

2537
# We will only run this action when:
2638
# 1. This repository isn't the template repository
39+
# 2. The STEP is currently 3
2740
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
2841
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29-
if: ${{ !github.event.repository.is_template }}
42+
if: >-
43+
${{ !github.event.repository.is_template
44+
&& needs.get_current_step.outputs.current_step == 3 }}
3045
3146
# We'll run Ubuntu for performance instead of Mac or Windows
3247
runs-on: ubuntu-latest

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ _Learn why conflicts happen and how to resolve them._
1818
Do not use quotes on the <details> tag attributes.
1919
-->
2020

21-
<!--step0-->
21+
<details id=0 open>
22+
<summary><h2>Welcome</h2></summary>
2223

2324
Merge conflicts happen when two people make changes to the same file on GitHub—a common occurrence when you’re working with others. While resolving differences might involve some discussion, merge conflicts don’t have to be scary. This course guides you through the steps to finding the best merge conflict solution, so your team can keep building.
2425

@@ -30,15 +31,15 @@ Merge conflicts happen when two people make changes to the same file on GitHub
3031

3132
## How to start this course
3233

33-
1. Above these instructions, right-click **Use this template** and open the link in a new tab.
34-
![Use this template](https://user-images.githubusercontent.com/1221423/169618716-fb17528d-f332-4fc5-a11a-eaa23562665e.png)
34+
1. Right-click **Start course** and open the link in a new tab.
35+
<br />[![start-course](https://user-images.githubusercontent.com/1221423/218596841-0645fe1a-4aaf-4f51-9ab3-8aa2d3fdd487.svg)](https://github.com/skills/resolve-merge-conflicts/generate)
3536
2. In the new tab, follow the prompts to create a new repository.
3637
- For owner, choose your personal account or an organization to host the repository.
3738
- We recommend creating a public repository—private repositories will [use Actions minutes](https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions).
38-
![Create a new repository](https://user-images.githubusercontent.com/1221423/169618722-406dc508-add4-4074-83f0-c7a7ad87f6f3.png)
39+
![Create a new repository](https://user-images.githubusercontent.com/1221423/218594143-e60462b6-9f2a-4fa3-80de-063ac5429aab.png)
3940
3. After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.
4041

41-
<!--endstep0-->
42+
</details>
4243

4344
<!--
4445
<<< Author notes: Step 1 >>>

0 commit comments

Comments
 (0)