|
| 1 | +# Post Step Content Action |
| 2 | + |
| 3 | +A composite action that posts step content to GitHub issues for GitHub Skills exercises. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +```yaml |
| 8 | +- name: Post step content |
| 9 | + uses: skills/exercise-toolkit/actions/[email protected] |
| 10 | + with: |
| 11 | + issue-url: ${{ needs.find_exercise.outputs.issue-url }} |
| 12 | + step-content-file: ".github/steps/2-commit-a-file.md" |
| 13 | +``` |
| 14 | +
|
| 15 | +## Inputs |
| 16 | +
|
| 17 | +| Input | Description | Required | Default | |
| 18 | +| ------------------- | ------------------------------------------------- | -------- | ------- | |
| 19 | +| `issue-url` | URL of the issue to post content to | ✅ | - | |
| 20 | +| `step-content-file` | Path to the markdown file containing step content | ✅ | - | |
| 21 | +| `template-vars` | Template variables in YAML or JSON format | ❌ | `""` | |
| 22 | + |
| 23 | +## Examples |
| 24 | + |
| 25 | +### Basic Usage |
| 26 | + |
| 27 | +```yaml |
| 28 | +- uses: skills/exercise-toolkit/actions/[email protected] |
| 29 | + with: |
| 30 | + issue-url: ${{ needs.find_exercise.outputs.issue-url }} |
| 31 | + step-content-file: ".github/steps/3-open-a-pull-request.md" |
| 32 | +``` |
| 33 | + |
| 34 | +### With Template Variables |
| 35 | + |
| 36 | +```yaml |
| 37 | +- uses: skills/exercise-toolkit/actions/[email protected] |
| 38 | + with: |
| 39 | + issue-url: ${{ needs.find_exercise.outputs.issue-url }} |
| 40 | + step-content-file: ".github/steps/step-finished-prepare-next-step.md" |
| 41 | + template-vars: | |
| 42 | + next_step_number: 4 |
| 43 | + congratulations_message: "Great work!" |
| 44 | +``` |
| 45 | + |
| 46 | +### Using Development Version |
| 47 | + |
| 48 | +```yaml |
| 49 | +- uses: skills/exercise-toolkit/actions/post-step-content@main |
| 50 | + with: |
| 51 | + issue-url: ${{ needs.find_exercise.outputs.issue-url }} |
| 52 | + step-content-file: ".github/steps/x-review.md" |
| 53 | +``` |
| 54 | + |
| 55 | +## What This Action Does |
| 56 | + |
| 57 | +1. **Checkout exercise-toolkit**: Gets the markdown templates |
| 58 | +2. **Process templates** (if template-vars provided): Uses `skills/action-text-variables` to process template variables |
| 59 | +3. **Post step completion message**: Adds a congratulatory comment indicating the step is finished |
| 60 | +4. **Post step content**: Adds the step content as an issue comment |
| 61 | +5. **Add progress comment**: Posts a "watching for progress" comment |
| 62 | + |
| 63 | +## Requirements |
| 64 | + |
| 65 | +- Requires `GITHUB_TOKEN` with `issues: write` permissions |
| 66 | +- The calling workflow must have checked out the repository to access step content files |
| 67 | + |
| 68 | +## Development |
| 69 | + |
| 70 | +This action is part of the GitHub Skills exercise-toolkit and is designed to standardize step content posting across all GitHub Skills exercises. |
0 commit comments