Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update course format for accessibility #29

Merged
merged 8 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/script/update-step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# chmod a+x .github/script/update-step.sh

echo "Check that we are on FROM_STEP"
if [ "$(cat .github/script/STEP)" != $FROM_STEP ]
if [ "$(cat .github/steps/-step.txt)" != $FROM_STEP ]
then
echo "Current step is not $FROM_STEP"
exit 0
Expand All @@ -17,18 +17,18 @@ sed -r 's/<details id=([0-9]+) open>/<details id=\1>/g' README.md > tmp
mv tmp README.md

echo "Add 'open' to step TO_STEP"
sed -r "s/<details id=$TO_STEP>/<details id=$TO_STEP open>/g" README.md > tmp
sed -r "s/<details id=$TO_STEP>/<details id=$TO_STEPopen>/g" README.md > tmp
mv tmp README.md

echo "Update the STEP file to TO_STEP"
echo "$TO_STEP" > .github/script/STEP
echo "Update the step file to TO_STEP"
echo "$TO_STEP" > .github/steps/-step.txt

echo "Commit the files, and push to main"
git config user.name github-actions
git config user.email github-actions@github.com
git add README.md
git add .github/script/STEP
git commit --message="Update to $TO_STEP in STEP and README.md"
git add .github/steps/-step.txt
git commit --message="Update to $TO_STEPin step and README.md"
git push

echo "If BRANCH_NAME, update that branch as well"
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .github/steps/0-welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- readme -->
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added .github/steps/X-finish.md
Empty file.
Empty file added .github/steps/my-workflow.md
Empty file.
26 changes: 12 additions & 14 deletions .github/workflows/0-start.yml → .github/workflows/0-welcome.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Step 0, Start
name: Step 0, Welcome

# This step triggers after the learner creates a new repository from the template
# This step sets STEP to 1
# This step closes <details id=0> and opens <details id=1>
# This workflow updates from step 0 to step 1.

# When creating a repository from a template, there is variability in the
# order and timing of events that fire and when workflow triggers are registered.
# Given that, these triggers are purposely broad to ensure this workflow is always triggered.
# The conditions within the on_start job are to ensure it is only fully executed once.
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
create:
workflow_dispatch:
Expand All @@ -19,7 +18,7 @@ permissions:
issues: write

jobs:
# Get the current step from .github/script/STEP so we can
# Get the current step from .github/steps/-step.txt so we can
# limit running the main job when the learner is on the same step.
get_current_step:
name: Check current step number
Expand All @@ -29,7 +28,7 @@ jobs:
uses: actions/checkout@v3
- id: get_step
run: |
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

Expand All @@ -39,9 +38,9 @@ jobs:

# We will only run this action when:
# 1. This repository isn't the template repository
# 2. The STEP is currently 0
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 2. The step is currently 0
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: >-
${{ !github.event.repository.is_template
&& needs.get_current_step.outputs.current_step == 0 }}
Expand All @@ -62,7 +61,7 @@ jobs:
- name: Prepare labels
run: |
echo "Make sure we are on step 0"
if [ "$(cat .github/script/STEP)" != 0 ]
if [ "$(cat .github/steps/-step.txt)" != 0 ]
then
echo "Current step is not 0"
exit 0
Expand All @@ -79,7 +78,7 @@ jobs:
- name: Prepare issues
run: |
echo "Make sure we are on step 0"
if [ "$(cat .github/script/STEP)" != 0 ]
if [ "$(cat .github/steps/-step.txt)" != 0 ]
then
echo "Current step is not 0"
exit 0
Expand All @@ -91,9 +90,8 @@ jobs:

# Update README to close <details id=0>
# and open <details id=1>
# and set STEP to '1'
- name: Update to step 1
uses: skills/action-update-step@v1
- name: Update to step 1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 0
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/1-initialize-javascript-project.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Step 1, Initialize JavaScript Project

# This step listens for the learner pushing a commit to `main`
# This step sets STEP to 2
# This step closes <details id=1> and opens <details id=2>
# This workflow updates from step 1 to step 2.

# This will run every time we push a commit to `main`
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows

on:
workflow_dispatch:
Expand All @@ -19,7 +18,7 @@ permissions:
contents: write

jobs:
# Get the current step from .github/script/STEP so we can
# Get the current step from .github/steps/-step.txt so we can
# limit running the main job when the learner is on the same step.
get_current_step:
name: Check current step number
Expand All @@ -29,7 +28,7 @@ jobs:
uses: actions/checkout@v3
- id: get_step
run: |
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

Expand All @@ -39,9 +38,9 @@ jobs:

# We will only run this action when:
# 1. This repository isn't the template repository
# 2. The STEP is currently 1
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 2. The step is currently 1
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: >-
${{ !github.event.repository.is_template
&& needs.get_current_step.outputs.current_step == 1 }}
Expand All @@ -68,10 +67,9 @@ jobs:

# Update README to close <details id=1>
# and open <details id=2>
# and set STEP to '2'
- name: Update to step 2
- name: Update to step 2
if: steps.check_files.outputs.files_exists == 'true'
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 1
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/2-configure-your-action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Step 2, Configure Your Action

# This step listens for the learner pushing a commit to `main`
# This step sets STEP to 3
# This step closes <details id=2> and opens <details id=3>
# This workflow updates from step 2 to step 3.

# This will run every time we push a commit to `main`
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
Expand All @@ -18,7 +17,7 @@ permissions:
contents: write

jobs:
# Get the current step from .github/script/STEP so we can
# Get the current step from .github/steps/-step.txt so we can
# limit running the main job when the learner is on the same step.
get_current_step:
name: Check current step number
Expand All @@ -28,7 +27,7 @@ jobs:
uses: actions/checkout@v3
- id: get_step
run: |
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

Expand All @@ -38,9 +37,9 @@ jobs:

# We will only run this action when:
# 1. This repository isn't the template repository
# 2. The STEP is currently 2
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 2. The step is currently 2
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: >-
${{ !github.event.repository.is_template
&& needs.get_current_step.outputs.current_step == 2 }}
Expand Down Expand Up @@ -68,10 +67,9 @@ jobs:

# Update README to close <details id=2>
# and open <details id=3>
# and set STEP to '3'
- name: Update to step 3
- name: Update to step 3
if: steps.check_files.outputs.files_exists == 'true'
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 2
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/3-create-metadata-file.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Step 3, Create Metadata File

# This step listens for the learner pushing a commit to `main`
# This step sets STEP to 4
# This step closes <details id=3> and opens <details id=4>
# This workflow updates from step 3 to step 4.

# This will run every time we push a commit to `main`
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
Expand All @@ -20,7 +19,7 @@ env:
EXPECTED_METADATA: outputs

jobs:
# Get the current step from .github/script/STEP so we can
# Get the current step from .github/steps/-step.txt so we can
# limit running the main job when the learner is on the same step.
get_current_step:
name: Check current step number
Expand All @@ -30,7 +29,7 @@ jobs:
uses: actions/checkout@v3
- id: get_step
run: |
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

Expand All @@ -40,9 +39,9 @@ jobs:

# We will only run this action when:
# 1. This repository isn't the template repository
# 2. The STEP is currently 3
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 2. The step is currently 3
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: >-
${{ !github.event.repository.is_template
&& needs.get_current_step.outputs.current_step == 3 }}
Expand Down Expand Up @@ -70,10 +69,9 @@ jobs:

# Update README to close <details id=3>
# and open <details id=4>
# and set STEP to '4'
- name: Update to step 4
- name: Update to step 4
if: (contains(steps.read_action_yml_file.outputs.contents, ${{ env.EXPECTED_METADATA }})
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 3
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/4-create-javascript-files-for-action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Step 4, Create JavaScript Files For Action

# This step listens for the learner pushing a commit to `main`
# This step sets STEP to 5
# This step closes <details id=4> and opens <details id=5>
# This workflow updates from step 4 to step 5.

# This will run every time we push a commit to `main`
# Reference https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
Expand All @@ -17,7 +16,7 @@ permissions:
contents: write

jobs:
# Get the current step from .github/script/STEP so we can
# Get the current step from .github/steps/-step.txt so we can
# limit running the main job when the learner is on the same step.
get_current_step:
name: Check current step number
Expand All @@ -27,7 +26,7 @@ jobs:
uses: actions/checkout@v3
- id: get_step
run: |
echo "current_step=$(cat ./.github/script/STEP)" >> $GITHUB_OUTPUT
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}

Expand All @@ -37,9 +36,9 @@ jobs:

# We will only run this action when:
# 1. This repository isn't the template repository
# 2. The STEP is currently 4
# Reference https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference https://docs.github.com/en/actions/learn-github-actions/expressions
# 2. The step is currently 4
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
if: >-
${{ !github.event.repository.is_template
&& needs.get_current_step.outputs.current_step == 4 }}
Expand Down Expand Up @@ -67,10 +66,9 @@ jobs:

# Update README to close <details id=4>
# and open <details id=5>
# and set STEP to '5'
- name: Update to step 5
- name: Update to step 5
if: steps.check_files.outputs.files_exists == 'true'
uses: skills/action-update-step@v1
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 4
Expand Down