skills-introduction-to-github

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

0-start-exercise.yml (1856B)


      1 name: Step 0 # Start Exercise
      2 
      3 on:
      4   push:
      5     branches:
      6       - main
      7 
      8 permissions:
      9   contents: write # Update Readme
     10   actions: write # Disable/enable workflows
     11   issues: write # Create issue and comment on issues
     12 
     13 
     14 env:
     15   STEP_1_FILE: ".github/steps/1-create-a-branch.md"
     16 
     17 jobs:
     18   start_exercise:
     19     if: |
     20       !github.event.repository.is_template
     21     name: Start Exercise
     22     uses: skills/exercise-toolkit/.github/workflows/start-exercise.yml@v0.1.0
     23     with:
     24       exercise-title: "Introduction to GitHub"
     25       intro-message: "If you are new to GitHub, you might find your fellow developers use ___**issues**___  to organize their work and collaborate. We will do the same! That's another lesson, but today, we will introduce you to the basics."
     26 
     27 
     28   post_next_step_content:
     29     name: Post next step content
     30     runs-on: ubuntu-latest
     31     needs: [start_exercise]
     32     env:
     33       ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }}
     34 
     35     steps:
     36       - name: Checkout
     37         uses: actions/checkout@v4
     38 
     39       - name: Get response templates
     40         uses: actions/checkout@v4
     41         with:
     42           repository: skills/exercise-toolkit
     43           path: exercise-toolkit
     44           ref: v0.1.0
     45 
     46       - name: Create comment - add step content
     47         run: |
     48           gh issue comment "$ISSUE_URL" \
     49             --body-file ${{ env.STEP_1_FILE }}
     50         env:
     51           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     52 
     53       - name: Create comment - watching for progress
     54         run: |
     55           gh issue comment "$ISSUE_URL" \
     56             --body-file exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md
     57         env:
     58           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     59 
     60       - name: Disable current workflow and enable next one
     61         run: |
     62           gh workflow enable "Step 1"
     63         env:
     64           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}