Skip to content

Commit 0f03c9b

Browse files
authored
Initial commit
0 parents  commit 0f03c9b

19 files changed

+921
-0
lines changed

.github/script/STEP

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

.github/workflows/0-start.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Step 0, Start
2+
3+
# This step triggers after the learner creates a new repository from the template
4+
# This step sets STEP to 1
5+
# This step closes <details id=0> and opens <details id=1>
6+
7+
# This will run every time we create push a commit to `main`
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- main
14+
15+
# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
16+
permissions:
17+
# Need `contents: read` to checkout the repository
18+
# Need `contents: write` to update the step metadata
19+
contents: write
20+
21+
jobs:
22+
on_start:
23+
name: On start
24+
25+
# We will only run this action when:
26+
# 1. This repository isn't the template repository
27+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
28+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29+
if: ${{ !github.event.repository.is_template }}
30+
31+
# We'll run Ubuntu for performance instead of Mac or Windows
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
# We'll need to check out the repository so that we can edit the README
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0 # Let's get all the branches
40+
41+
# Update README to close <details id=0> and open <details id=1>
42+
# and set STEP to '1'
43+
- name: Update to step 1
44+
uses: skills/action-update-step@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
from_step: 0
48+
to_step: 1
49+
branch_name: my-first-branch
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Step 1, Create a branch
2+
3+
# This step listens for the learner to create branch `my-first-branch`
4+
# This step sets STEP to 2
5+
# This step closes <details id=1> and opens <details id=2>
6+
7+
# This will run every time we create a branch or tag
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
create:
12+
13+
# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
14+
permissions:
15+
# Need `contents: read` to checkout the repository
16+
# Need `contents: write` to update the step metadata
17+
contents: write
18+
19+
jobs:
20+
on_create_a_branch:
21+
name: On create a branch
22+
23+
# We will only run this action when:
24+
# 1. This repository isn't the template repository
25+
# 2. The event is a branch
26+
# 3. The branch name is `my-first-branch`
27+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
28+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29+
if: ${{ !github.event.repository.is_template && github.ref_type == 'branch' && github.ref_name == 'my-first-branch' }}
30+
31+
# We'll run Ubuntu for performance instead of Mac or Windows
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
# We'll need to check out the repository so that we can edit the README
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0 # Let's get all the branches
40+
41+
# Update README to close <details id=1> and open <details id=2>
42+
# and set STEP to '2'
43+
- name: Update to step 2
44+
uses: skills/action-update-step@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
from_step: 1
48+
to_step: 2
49+
branch_name: my-first-branch

.github/workflows/2-commit-a-file.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Step 2, Commit a file
2+
3+
# This step listens for the learner to commit a file to branch `my-first-branch`
4+
# This step sets STEP to 3
5+
# This step closes <details id=2> and opens <details id=3>
6+
7+
# This action will run every time there's a push to `my-first-branch`
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- my-first-branch
14+
15+
# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
16+
permissions:
17+
# Need `contents: read` to checkout the repository
18+
# Need `contents: write` to update the step metadata
19+
contents: write
20+
21+
jobs:
22+
on_commit_a_file:
23+
name: On commit a file
24+
25+
# We will only run this action when:
26+
# 1. This repository isn't the template repository
27+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
28+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29+
if: ${{ !github.event.repository.is_template }}
30+
31+
# We'll run Ubuntu for performance instead of Mac or Windows
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
# We'll need to check out the repository so that we can edit the README
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0 # Let's get all the branches
40+
41+
# Update README to close <details id=2> and open <details id=3>
42+
# and set STEP to '3'
43+
- name: Update to step 3
44+
uses: skills/action-update-step@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
from_step: 2
48+
to_step: 3
49+
branch_name: my-first-branch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Step 3, Open a pull request
2+
3+
# This step listens for the learner to open a pull request with branch `my-first-branch`
4+
# This step sets STEP to 4
5+
# This step closes <details id=3> and opens <details id=4>
6+
7+
# This will run every time we create a branch or tag
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
pull_request:
12+
types:
13+
- opened
14+
- reopened
15+
16+
# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
17+
permissions:
18+
# Need `contents: read` to checkout the repository
19+
# Need `contents: write` to update the step metadata
20+
contents: write
21+
22+
jobs:
23+
on_open_a_pull_request:
24+
name: On open a pull request
25+
26+
# We will only run this action when:
27+
# 1. This repository isn't the template repository
28+
# 2. The head branch name is `my-first-branch`
29+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
30+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
31+
if: ${{ !github.event.repository.is_template && github.head_ref == 'my-first-branch' }}
32+
33+
# We'll run Ubuntu for performance instead of Mac or Windows
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
# We'll need to check out the repository so that we can edit the README
38+
- name: Checkout
39+
uses: actions/checkout@v2
40+
with:
41+
fetch-depth: 0 # Let's get all the branches
42+
ref: my-first-branch # Important, as normally `pull_request` event won't grab other branches
43+
44+
# Update README to close <details id=3> and open <details id=4>
45+
# and set STEP to '4'
46+
- name: Update to step 4
47+
uses: skills/action-update-step@v1
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
from_step: 3
51+
to_step: 4
52+
branch_name: my-first-branch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Step 4, Merge your pull request
2+
3+
# This step listens for the learner to merge a pull request with branch `my-first-branch`
4+
# This step sets STEP to x
5+
# This step closes <details id=4> and opens <details id=x>
6+
7+
# This will run every time we create push a commit to `main`
8+
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
9+
on:
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- main
14+
15+
# Reference https://docs.github.com/en/actions/security-guides/automatic-token-authentication
16+
permissions:
17+
# Need `contents: read` to checkout the repository
18+
# Need `contents: write` to update the step metadata
19+
contents: write
20+
21+
jobs:
22+
on_merge_your_pull_request:
23+
name: On merge your pull request
24+
25+
# We will only run this action when:
26+
# 1. This repository isn't the template repository
27+
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
28+
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
29+
if: ${{ !github.event.repository.is_template }}
30+
31+
# We'll run Ubuntu for performance instead of Mac or Windows
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
# We'll need to check out the repository so that we can edit the README
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0 # Let's get all the branches
40+
41+
# Update README to close <details id=4> and open <details id=X>
42+
# and set STEP to X
43+
- name: Update to step X
44+
uses: skills/action-update-step@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
from_step: 4
48+
to_step: X
49+
branch_name: my-first-branch

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
23+
# Logs and databases #
24+
######################
25+
*.log
26+
*.sql
27+
*.sqlite
28+
29+
# OS generated files #
30+
######################
31+
.DS_Store
32+
.DS_Store?
33+
._*
34+
.Spotlight-V100
35+
.Trashes
36+
ehthumbs.db
37+
Thumbs.db

0 commit comments

Comments
 (0)