Implementation:Testtimescaling Testtimescaling github io Skills Action Update Step
| Knowledge Sources | |
|---|---|
| Domains | Education, CI_CD, Event_Driven |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
Common workflow pattern used by steps 1 through 5 of the GitHub Pages course, wrapping the Template:Code external action to detect learner events and advance the course state machine.
Description
This implementation documents the shared structural pattern across five workflow files (Template:Code through Template:Code). Each file is a standalone GitHub Actions workflow that follows an identical two-job architecture:
- get_current_step job -- checks out the repository and reads the current step number from Template:Code
- on_<step_name> job -- guarded by the step check and template check, checks out the Template:Code branch, and invokes Template:Code to advance the step
The only variations across the five files are:
- The trigger event (Template:Code, Template:Code with branch/path filters)
- The step numbers (Template:Code and Template:Code)
- The job and step names (cosmetic labels)
The external action Template:Code handles the atomic state transition internally:
- Reads Template:Code
- Verifies the current value matches Template:Code
- Writes Template:Code to the file
- Replaces Template:Code content with the template from Template:Code
- Commits and pushes the changes
Usage
These workflows run automatically in response to learner actions:
- Step 1: Fires when GitHub Pages is enabled (detected via Template:Code event)
- Step 2: Fires when the learner edits Template:Code on the Template:Code branch
- Step 3: Fires when the learner edits Template:Code on the Template:Code branch
- Step 4: Fires when the learner creates a blog post in Template:Code on the Template:Code branch
- Step 5: Fires when the learner merges the pull request to main
No manual configuration is required for any step.
Code Reference
Source Location
- Repository: Testtimescaling/Testtimescaling.github.io
- Files:
- Template:Code (Lines 1-63)
- Template:Code (Lines 1-67)
- Template:Code (Lines 1-67)
- Template:Code (Lines 1-67)
- Template:Code (Lines 1-64)
Signature
The following is the representative common pattern, shown using step 2 (Template:Code) as the example:
name: Step 2, Configure your site
on:
workflow_dispatch:
push:
branches:
- my-pages
paths:
- _config.yml
permissions:
contents: write
jobs:
get_current_step:
name: Check current step number
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: get_step
run: |
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
outputs:
current_step: ${{ steps.get_step.outputs.current_step }}
on_config_update:
name: On config update
needs: get_current_step
if: >-
${{ !github.event.repository.is_template
&& needs.get_current_step.outputs.current_step == 2 }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: my-pages
- name: Update to step 3
uses: skills/action-update-step@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
from_step: 2
to_step: 3
branch_name: my-pages
Import
# These workflows are defined in the repository and run automatically.
# No import is needed. The external action is referenced via `uses:`:
# - skills/action-update-step@v2
# Checkout is provided by:
# - actions/checkout@v4
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| GitHub event | Webhook event | Yes | The trigger event varies by step: Template:Code (step 1), Template:Code with path filters (steps 2-4), or Template:Code to main (step 5) |
| .github/steps/-step.txt | File (integer) | Yes | Must contain the expected step number (1, 2, 3, 4, or 5) for the corresponding workflow to proceed |
| secrets.GITHUB_TOKEN | Token | Yes | Automatically provided by GitHub Actions; passed to Template:Code for authenticated commits |
| from_step | Integer | Yes | The current step number; must match the value in the state file |
| to_step | Integer or "X" | Yes | The next step number; Template:Code indicates course completion (used by step 5) |
| branch_name | String | Yes | The branch to update; always Template:Code in this course |
Outputs
| Name | Type | Description |
|---|---|---|
| .github/steps/-step.txt | File (integer) | Updated to the Template:Code value (next step number or Template:Code) |
| README.md | File | Replaced with the content from Template:Code, providing the learner with instructions for the next step |
Usage Examples
Example: Step 1 -- Enable GitHub Pages (page_build trigger)
1. Learner goes to repository Settings → Pages
2. Selects source branch (my-pages) and saves
3. GitHub builds the page and emits a page_build event
4. Workflow 1-enable-github-pages.yml triggers
5. get_current_step reads "1" from .github/steps/-step.txt
6. Guard passes: is_template is false AND current_step == 1
7. skills/action-update-step@v2 advances step from 1 to 2
8. README.md is updated with step 2 instructions ("Configure your site")
Example: Step 4 -- Create a Blog Post (push with path filter)
1. Learner creates _posts/2026-02-14-my-first-post.md on the my-pages branch
2. Learner commits and pushes the change
3. Push event fires with path matching _posts/*.md
4. Workflow 4-create-a-blog-post.yml triggers
5. get_current_step reads "4" from .github/steps/-step.txt
6. Guard passes: is_template is false AND current_step == 4
7. skills/action-update-step@v2 advances step from 4 to 5
8. README.md is updated with step 5 instructions ("Merge your pull request")
Example: Step 5 -- Merge Pull Request (push to main)
1. Learner merges the my-pages pull request into main
2. The merge creates a push event on the main branch
3. Workflow 5-merge-your-pull-request.yml triggers
4. get_current_step reads "5" from .github/steps/-step.txt
5. Guard passes: is_template is false AND current_step == 5
6. skills/action-update-step@v2 advances step from 5 to X
7. README.md is updated with the course completion message
Example: Guard Prevents Out-of-Order Execution
Scenario: Learner pushes to _config.yml while still on step 1
1. Push event fires with path matching _config.yml on my-pages
2. Workflow 2-configure-your-site.yml triggers
3. get_current_step reads "1" from .github/steps/-step.txt
4. Guard FAILS: current_step (1) != 2
5. The on_config_update job is skipped entirely
6. No state change occurs -- the course remains on step 1