|
| 1 | +name: Step 0 # Start Exercise |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + actions: write |
| 11 | + issues: write |
| 12 | + |
| 13 | +env: |
| 14 | + STEP_1_FILE: ".github/steps/1-step.md" |
| 15 | + |
| 16 | +jobs: |
| 17 | + start_exercise: |
| 18 | + name: Start Exercise |
| 19 | + uses: skills/exercise-toolkit/.github/workflows/[email protected] |
| 20 | + with: |
| 21 | + exercise-title: "Hello GitHub Actions" |
| 22 | + intro-message: "Create and run a GitHub Actions workflow." |
| 23 | + |
| 24 | + post_next_step_content: |
| 25 | + name: Post next step content |
| 26 | + runs-on: ubuntu-latest |
| 27 | + needs: [start_exercise] |
| 28 | + env: |
| 29 | + ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }} |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Get response templates |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + repository: skills/exercise-toolkit |
| 39 | + path: exercise-toolkit |
| 40 | + ref: v0.6.0 |
| 41 | + |
| 42 | + - name: Build comment - add step content |
| 43 | + id: build-comment |
| 44 | + uses: skills/action-text-variables@v2 |
| 45 | + with: |
| 46 | + template-file: ${{ env.STEP_1_FILE }} |
| 47 | + template-vars: | |
| 48 | + login: ${{ github.actor }} |
| 49 | + full_repo_name: ${{ github.repository }} |
| 50 | +
|
| 51 | + - name: Create comment - add step content |
| 52 | + run: | |
| 53 | + gh issue comment "$ISSUE_URL" \ |
| 54 | + --body "$ISSUE_BODY" |
| 55 | + env: |
| 56 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + ISSUE_BODY: ${{ steps.build-comment.outputs.updated-text }} |
| 58 | + |
| 59 | + - name: Create comment - watching for progress |
| 60 | + run: | |
| 61 | + gh issue comment "$ISSUE_URL" \ |
| 62 | + --body-file "exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md" |
| 63 | + env: |
| 64 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + |
| 66 | + - name: Enable next step workflow |
| 67 | + run: | |
| 68 | + gh workflow enable "Step 1" |
| 69 | + env: |
| 70 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments