From 06895ddb0b58d847d2202172033b0b27d1c1c7bf Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 08:38:17 +0000 Subject: [PATCH 01/11] refactor: use latest workflow structure --- .github/workflows/0-start-exercise.yml | 34 +++---- .github/workflows/1-preparing.yml | 84 ++++------------ .github/workflows/2-first-introduction.yml | 99 +++++++++--------- .github/workflows/3-copilot-edits.yml | 106 +++++++++----------- .github/workflows/3b-copilot-agent-mode.yml | 53 +++++----- .github/workflows/4-copilot-on-github.yml | 67 ++++--------- .github/workflows/4b-copilot-on-github.yml | 28 ++---- 7 files changed, 187 insertions(+), 284 deletions(-) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index bb09fee..5a838ef 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -28,7 +28,8 @@ jobs: runs-on: ubuntu-latest needs: [start_exercise] env: - ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }} + ISSUE_NUMBER: ${{ needs.start_exercise.outputs.issue-number }} + ISSUE_REPOSITORY: ${{ github.repository }} steps: - name: Checkout @@ -41,31 +42,24 @@ jobs: path: exercise-toolkit ref: v0.6.0 - - name: Build comment - add step content - id: build-comment - uses: skills/action-text-variables@v2 + - name: Create comment - add step content + uses: GrantBirki/comment@v2.1.1 with: - template-file: ${{ env.STEP_1_FILE }} - template-vars: | + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: ${{ env.STEP_1_FILE }} + vars: | login: ${{ github.actor }} full_repo_name: ${{ github.repository }} - - name: Create comment - add step content - run: | - gh issue comment "$ISSUE_URL" \ - --body "$ISSUE_BODY" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_BODY: ${{ steps.build-comment.outputs.updated-text }} - - name: Create comment - watching for progress - run: | - gh issue comment "$ISSUE_URL" \ - --body-file "exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - - name: Disable current workflow and enable next one + - name: Enable next step workflow run: | gh workflow enable "Step 1" env: diff --git a/.github/workflows/1-preparing.yml b/.github/workflows/1-preparing.yml index 44f65cd..6abbbc9 100644 --- a/.github/workflows/1-preparing.yml +++ b/.github/workflows/1-preparing.yml @@ -18,12 +18,13 @@ jobs: name: Find Exercise Issue uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 - check_step_work: - name: Check step work - runs-on: ubuntu-latest + post_next_step_content: + name: Post next step content needs: [find_exercise] + runs-on: ubuntu-latest env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} steps: - name: Checkout @@ -36,73 +37,32 @@ jobs: path: exercise-toolkit ref: v0.6.0 - - name: Update comment - checking work - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/checking-work.md \ - --edit-last - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # START: Check practical exercise - - # Nothing to verify. Creating the branch is enough for now. - # In a future update, we will check that the codepsace is running and that the website is visible. - - # END: Check practical exercise - - - name: Build message - step finished - id: build-message-step-finish - uses: skills/action-text-variables@v2 + - name: Create comment - step finished + uses: GrantBirki/comment@v2.1.1 with: - template-file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md - template-vars: | + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md + vars: | next_step_number: 2 - - name: Update comment - step finished - run: | - gh issue comment "$ISSUE_URL" \ - --body "$ISSUE_BODY" \ - --edit-last - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_BODY: ${{ steps.build-message-step-finish.outputs.updated-text }} - - post_next_step_content: - name: Post next step content - needs: [find_exercise, check_step_work] - runs-on: ubuntu-latest - env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Get response templates - uses: actions/checkout@v4 - with: - repository: skills/exercise-toolkit - path: exercise-toolkit - ref: v0.6.0 - - name: Create comment - add step content - run: | - gh issue comment "$ISSUE_URL" \ - --body-file "$STEP_2_FILE" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: ${{ env.STEP_2_FILE }} - name: Create comment - watching for progress - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - name: Disable current workflow and enable next one run: | - gh workflow disable "Step 1" + gh workflow disable "${{github.workflow}}" gh workflow enable "Step 2" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/2-first-introduction.yml b/.github/workflows/2-first-introduction.yml index cd908f0..89bca0f 100644 --- a/.github/workflows/2-first-introduction.yml +++ b/.github/workflows/2-first-introduction.yml @@ -25,7 +25,8 @@ jobs: runs-on: ubuntu-latest needs: [find_exercise] env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} steps: - name: Checkout @@ -38,13 +39,23 @@ jobs: path: exercise-toolkit ref: v0.6.0 + - name: Find last comment + id: find-last-comment + uses: peter-evans/find-comment@v3 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + direction: last + + - name: Update comment - checking work - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/checking-work.md \ - --edit-last - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + comment-id: ${{ steps.find-last-comment.outputs.comment-id }} + file: exercise-toolkit/markdown-templates/step-feedback/checking-work.md + edit-mode: replace # START: Check practical exercise @@ -58,53 +69,32 @@ jobs: minimum-occurrences: 4 case-sensitive: false - - name: Build message - step results - id: build-message-step-results - uses: skills/action-text-variables@v2 + - name: Update comment - step results + uses: GrantBirki/comment@v2.1.1 with: - template-file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md - template-vars: | + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + comment-id: ${{ steps.find-last-comment.outputs.comment-id }} + edit-mode: replace + file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md + vars: | step_number: 2 - passed: ${{ !contains(steps.*.outcome, 'failure') }} results_table: - description: "New activities added to src/app.py. We found ${{ steps.check-additional-activities.outputs.occurrences }} activities (minimum 4 required)" passed: ${{ steps.check-additional-activities.outcome == 'success' }} - - name: Create comment - step results - run: | - gh issue comment "$ISSUE_URL" \ - --body "$COMMENT_BODY" \ - --edit-last - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMENT_BODY: ${{ steps.build-message-step-results.outputs.updated-text }} - - name: Fail job if not all checks passed if: contains(steps.*.outcome, 'failure') run: exit 1 - - name: Build message - step finished - id: build-message-step-finish - uses: skills/action-text-variables@v2 - with: - template-file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md - template-vars: | - next_step_number: 3 - - - name: Update comment - step finished - run: | - gh issue comment "$ISSUE_URL" \ - --body "$ISSUE_BODY" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_BODY: ${{ steps.build-message-step-finish.outputs.updated-text }} post_next_step_content: name: Post next step content needs: [find_exercise, check_step_work] runs-on: ubuntu-latest env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} steps: - name: Checkout @@ -117,23 +107,34 @@ jobs: path: exercise-toolkit ref: v0.6.0 + - name: Create comment - step finished + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md + vars: | + next_step_number: 3 + + - name: Create comment - add step content - run: | - gh issue comment "$ISSUE_URL" \ - --body-file "$STEP_3_FILE" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: ${{ env.STEP_3_FILE }} - name: Create comment - watching for progress - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md + - name: Disable current workflow and enable next one run: | - gh workflow disable "Step 2" + gh workflow disable "${{github.workflow}}" gh workflow enable "Step 3" gh workflow enable "Step 3b" env: diff --git a/.github/workflows/3-copilot-edits.yml b/.github/workflows/3-copilot-edits.yml index bff6811..0f92965 100644 --- a/.github/workflows/3-copilot-edits.yml +++ b/.github/workflows/3-copilot-edits.yml @@ -25,7 +25,9 @@ jobs: runs-on: ubuntu-latest needs: [find_exercise] env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} + steps: - name: Checkout @@ -38,13 +40,22 @@ jobs: path: exercise-toolkit ref: v0.6.0 + - name: Find last comment + id: find-last-comment + uses: peter-evans/find-comment@v3 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + direction: last + - name: Update comment - checking work - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/checking-work.md \ - --edit-last - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + comment-id: ${{ steps.find-last-comment.outputs.comment-id }} + file: exercise-toolkit/markdown-templates/step-feedback/checking-work.md + edit-mode: replace - name: Check for participant info in app.js id: check-app-js @@ -56,58 +67,24 @@ jobs: minimum-occurrences: 3 case-sensitive: false - - name: Check for participant info in styles.css - id: check-styles - continue-on-error: true - uses: skills/action-keyphrase-checker@v1 - with: - text-file: src/static/styles.css - keyphrase: participant - case-sensitive: false - - - name: Build message - step results - id: build-message-step-results - uses: skills/action-text-variables@v2 + - name: Update comment - step results + uses: GrantBirki/comment@v2.1.1 with: - template-file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md - template-vars: | + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + comment-id: ${{ steps.find-last-comment.outputs.comment-id }} + edit-mode: replace + file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md + vars: | step_number: 3 - passed: ${{ !contains(steps.*.outcome, 'failure') }} results_table: - description: "Check app.js for participant info" passed: ${{ steps.check-app-js.outcome == 'success' }} - - description: "Participant styling updated in styles.css" - passed: ${{ steps.check-styles.outcome == 'success' }} - - - name: Create comment - step results - run: | - gh issue comment "$ISSUE_URL" \ - --body "$COMMENT_BODY" \ - --edit-last - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMENT_BODY: ${{ steps.build-message-step-results.outputs.updated-text }} - name: Fail job if not all checks passed if: contains(steps.*.outcome, 'failure') run: exit 1 - - name: Build message - step finished - id: build-message-step-finish - uses: skills/action-text-variables@v2 - with: - template-file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md - template-vars: | - next_step_number: 4 - - - name: Update comment - step finished - run: | - gh issue comment "$ISSUE_URL" \ - --body "$ISSUE_BODY" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_BODY: ${{ steps.build-message-step-finish.outputs.updated-text }} - post_next_step_content: name: Post next step content needs: [find_exercise, check_step_work] @@ -126,23 +103,32 @@ jobs: path: exercise-toolkit ref: v0.6.0 + - name: Create comment - step finished + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md + vars: | + next_step_number: 4 + - name: Create comment - add step content - run: | - gh issue comment "$ISSUE_URL" \ - --body-file "$STEP_4_FILE" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: ${{ env.STEP_4_FILE }} - name: Create comment - watching for progress - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - name: Disable current workflow and enable next one run: | - gh workflow disable "Step 3" + gh workflow disable "${{github.workflow}}" gh workflow enable "Step 4" gh workflow enable "Step 4b" env: diff --git a/.github/workflows/3b-copilot-agent-mode.yml b/.github/workflows/3b-copilot-agent-mode.yml index 773bec9..89c97f7 100644 --- a/.github/workflows/3b-copilot-agent-mode.yml +++ b/.github/workflows/3b-copilot-agent-mode.yml @@ -11,36 +11,37 @@ permissions: env: # Keywords required in the issue comment to allow this workflow to run - REQUIRED_ISSUE_COMMENT_KEYWORDS: "@professortocat,Agent" STEP_3B_FILE: ".github/steps/3b-copilot-agent-mode.md" jobs: - required_issue_comment_keywords: - name: Check issue comment text for required keywords + check_keywords: + name: Check issue comment text for required keyword runs-on: ubuntu-latest - steps: - - name: Stop early if missing the expected keywords, case insensitive - shell: bash - run: | - required_keywords=(${REQUIRED_ISSUE_COMMENT_KEYWORDS//,/ }) - comment_body_lower=$(echo "$COMMENT_BODY" | tr '[:upper:]' '[:lower:]') - for keyword in "${required_keywords[@]}"; do - keyword_lower=$(echo "$keyword" | tr '[:upper:]' '[:lower:]') - if [[ ! "$comment_body_lower" =~ $keyword_lower ]]; then - exit 1 - fi - done - env: - COMMENT_BODY: ${{ github.event.comment.body }} + - name: Check for professortocat reference + id: check_professortocat + uses: skills/action-keyphrase-checker@v1 + with: + text: ${{ github.event.comment.body }} + keyphrase: "professortocat" + case-sensitive: false + minimum-occurrences: 1 + - name: Check for alert reference + id: check_alert + uses: skills/action-keyphrase-checker@v1 + with: + text: ${{ github.event.comment.body }} + keyphrase: "agent" + case-sensitive: false + minimum-occurrences: 1 find_exercise: name: Find Exercise Issue uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 - post_step_3b_content: - name: Post step 3b content - needs: [find_exercise, required_issue_comment_keywords] + post_next_step_content: + name: Post next step content + needs: [find_exercise, check_keywords] runs-on: ubuntu-latest env: ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} @@ -50,14 +51,14 @@ jobs: uses: actions/checkout@v4 - name: Create comment - add step content - run: | - gh issue comment "$ISSUE_URL" \ - --body-file "$STEP_3B_FILE" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: ${{ env.STEP_3B_FILE }} - name: Disable current workflow run: | - gh workflow disable "Step 3b" + gh workflow disable "${{github.workflow}}" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/4-copilot-on-github.yml b/.github/workflows/4-copilot-on-github.yml index f94aadb..e623519 100644 --- a/.github/workflows/4-copilot-on-github.yml +++ b/.github/workflows/4-copilot-on-github.yml @@ -20,18 +20,18 @@ jobs: name: Find Exercise Issue uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 - check_step_work: - name: Check step work - runs-on: ubuntu-latest + post_review_content: + name: Post review content needs: [find_exercise] + runs-on: ubuntu-latest env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Get response templates uses: actions/checkout@v4 with: @@ -39,42 +39,22 @@ jobs: path: exercise-toolkit ref: v0.6.0 - # START: Check practical exercise - - # Nothing to check. Merging the pull request is enough. - - # END: Check practical exercise - - name: Create comment - step finished - final review next - run: | - gh issue comment "$ISSUE_URL" \ - --body-file exercise-toolkit/markdown-templates/step-feedback/lesson-review.md - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - post_review_content: - name: Post review content - needs: [find_exercise, check_step_work] - runs-on: ubuntu-latest - env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/lesson-review.md - - name: Get response templates - uses: actions/checkout@v4 + - name: Create comment - add review content + uses: GrantBirki/comment@v2.1.1 with: - repository: skills/exercise-toolkit - path: exercise-toolkit - ref: v0.6.0 + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: ${{ env.REVIEW_FILE }} - - name: Create comment - add step content - run: | - gh issue comment "$ISSUE_URL" \ - --body-file "$REVIEW_FILE" + - name: Disable current workflow + run: gh workflow disable "${{github.workflow}}" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -85,16 +65,3 @@ jobs: with: issue-url: ${{ needs.find_exercise.outputs.issue-url }} exercise-title: "Getting Started with GitHub Copilot" - - disable_workflow: - name: Disable this workflow - needs: [find_exercise, post_review_content] - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Disable current workflow - run: gh workflow disable "${{github.workflow}}" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/4b-copilot-on-github.yml b/.github/workflows/4b-copilot-on-github.yml index 977ef7f..25e1746 100644 --- a/.github/workflows/4b-copilot-on-github.yml +++ b/.github/workflows/4b-copilot-on-github.yml @@ -29,7 +29,8 @@ jobs: runs-on: ubuntu-latest needs: [find_exercise] env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} steps: - name: Checkout @@ -61,6 +62,7 @@ jobs: PR_Body: ${{ github.event.pull_request.body }} - name: Check for Copilot review + continue-on-error: true id: check-copilot-review run: | # Check for a PR Review from Copilot @@ -78,33 +80,25 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} - continue-on-error: true - - name: Build message - step results - id: build-message-step-results - uses: skills/action-text-variables@v2 + + - name: Create comment - step results + uses: GrantBirki/comment@v2.1.1 with: - template-file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md - template-vars: | + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md + vars: | step_number: 4 - passed: ${{ !contains(steps.*.outcome, 'failure') }} results_table: - description: "Pull request contains a descriptive overview" passed: ${{ steps.check-pr-description.outcome == 'success' }} - description: "Pull request received a review from GitHub Copilot" passed: ${{ steps.check-copilot-review.outcome == 'success' }} tips: - - "If you already requested Copilot review and this check did not pass, go to your repository [actions](https://github.com/${{github.repository}}/actions) tab to check if a workflow run is awaiting your manual approval." + - "If you already requested Copilot review and this check did not pass, go to your repository [actions](https://github.com/${{ github.repository }}/actions) tab to check if a workflow run is awaiting your manual approval." - "You can use repository rulesets to automatically require a review from Copilot." - - name: Create comment - step results - run: | - gh issue comment "$ISSUE_URL" \ - --body "$COMMENT_BODY" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMENT_BODY: ${{ steps.build-message-step-results.outputs.updated-text }} - - name: Fail job if not all checks passed if: contains(steps.*.outcome, 'failure') run: exit 1 From 4bd041c0b4edc918e8ba143a6128082f76278212 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 08:54:47 +0000 Subject: [PATCH 02/11] use exercise-toolkit@main --- .github/workflows/0-start-exercise.yml | 4 ++-- .github/workflows/1-preparing.yml | 4 ++-- .github/workflows/2-first-introduction.yml | 6 +++--- .github/workflows/3-copilot-edits.yml | 6 +++--- .github/workflows/3b-copilot-agent-mode.yml | 2 +- .github/workflows/4-copilot-on-github.yml | 6 +++--- .github/workflows/4b-copilot-on-github.yml | 5 ++--- 7 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index 5a838ef..113678c 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -18,7 +18,7 @@ jobs: if: | !github.event.repository.is_template name: Start Exercise - uses: skills/exercise-toolkit/.github/workflows/start-exercise.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/start-exercise.yml@main with: exercise-title: "Getting Started with GitHub Copilot" intro-message: "Welcome to the exciting world of GitHub Copilot! 🚀 In this exercise, you'll unlock the potential of this AI-powered coding assistant to accelerate your development process. Let's dive in and have some fun exploring the future of coding together! 💻✨" @@ -40,7 +40,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Create comment - add step content uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/1-preparing.yml b/.github/workflows/1-preparing.yml index 6abbbc9..55f1d1b 100644 --- a/.github/workflows/1-preparing.yml +++ b/.github/workflows/1-preparing.yml @@ -16,7 +16,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main post_next_step_content: name: Post next step content @@ -35,7 +35,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Create comment - step finished uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/2-first-introduction.yml b/.github/workflows/2-first-introduction.yml index 89bca0f..bad24b4 100644 --- a/.github/workflows/2-first-introduction.yml +++ b/.github/workflows/2-first-introduction.yml @@ -18,7 +18,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main check_step_work: name: Check step work @@ -37,7 +37,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Find last comment id: find-last-comment @@ -105,7 +105,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Create comment - step finished uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/3-copilot-edits.yml b/.github/workflows/3-copilot-edits.yml index 0f92965..a9a2192 100644 --- a/.github/workflows/3-copilot-edits.yml +++ b/.github/workflows/3-copilot-edits.yml @@ -18,7 +18,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main check_step_work: name: Check step work @@ -38,7 +38,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Find last comment id: find-last-comment @@ -101,7 +101,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Create comment - step finished uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/3b-copilot-agent-mode.yml b/.github/workflows/3b-copilot-agent-mode.yml index 89c97f7..bae702b 100644 --- a/.github/workflows/3b-copilot-agent-mode.yml +++ b/.github/workflows/3b-copilot-agent-mode.yml @@ -37,7 +37,7 @@ jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main post_next_step_content: name: Post next step content diff --git a/.github/workflows/4-copilot-on-github.yml b/.github/workflows/4-copilot-on-github.yml index e623519..34ef5a7 100644 --- a/.github/workflows/4-copilot-on-github.yml +++ b/.github/workflows/4-copilot-on-github.yml @@ -18,7 +18,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main post_review_content: name: Post review content @@ -37,7 +37,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main - name: Create comment - step finished - final review next uses: GrantBirki/comment@v2.1.1 @@ -61,7 +61,7 @@ jobs: finish_exercise: name: Finish Exercise needs: [find_exercise, post_review_content] - uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@main with: issue-url: ${{ needs.find_exercise.outputs.issue-url }} exercise-title: "Getting Started with GitHub Copilot" diff --git a/.github/workflows/4b-copilot-on-github.yml b/.github/workflows/4b-copilot-on-github.yml index 25e1746..e0d84e0 100644 --- a/.github/workflows/4b-copilot-on-github.yml +++ b/.github/workflows/4b-copilot-on-github.yml @@ -22,7 +22,7 @@ permissions: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.6.0 + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main check_step_work: name: Check step work @@ -41,7 +41,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: v0.6.0 + ref: main # START: Check practical exercise @@ -81,7 +81,6 @@ jobs: REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} - - name: Create comment - step results uses: GrantBirki/comment@v2.1.1 with: From d2881d51b8a7a25895f87e2167256dbed68d0655 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 08:58:31 +0000 Subject: [PATCH 03/11] fix mustache style curly braces --- .github/steps/1-preparing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/steps/1-preparing.md b/.github/steps/1-preparing.md index feb8147..8a9703f 100644 --- a/.github/steps/1-preparing.md +++ b/.github/steps/1-preparing.md @@ -38,7 +38,7 @@ Let's start up our development environment, use copilot to learn a bit about the 1. Confirm the **Repository** field is your copy of the exercise, not the original, then click the green **Create Codespace** button. - - ✅ Your copy: `/{{{full_repo_name}}}` + - ✅ Your copy: `/{{full_repo_name}}` - ❌ Original: `/skills/getting-started-with-github-copilot` 1. Wait a moment for Visual Studio Code to load in your browser. From 286767837d12ae3f1e6909b01d366549729782e6 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 09:25:37 +0000 Subject: [PATCH 04/11] Test run fixes --- .github/steps/1-preparing.md | 20 +--- .github/workflows/3-copilot-edits.yml | 16 +++- .github/workflows/4b-copilot-on-github.yml | 105 --------------------- 3 files changed, 16 insertions(+), 125 deletions(-) delete mode 100644 .github/workflows/4b-copilot-on-github.yml diff --git a/.github/steps/1-preparing.md b/.github/steps/1-preparing.md index 8a9703f..0b43377 100644 --- a/.github/steps/1-preparing.md +++ b/.github/steps/1-preparing.md @@ -55,7 +55,7 @@ Let's start up our development environment, use copilot to learn a bit about the 1. If this is your first time using GitHub Copilot, you will need to accept the usage terms to continue. -1. Enter the below prompt to ask Copilot to introduce you to the project. +1. Enter the below prompt to ask Copilot to introduce you to the project. Use Copilot **Ask Mode** for this prompt. > ![Static Badge](https://img.shields.io/badge/-Prompt-text?style=social&logo=github%20copilot) > @@ -98,23 +98,7 @@ Great work! Now that we are familiar with the app and we know it works, let's as > ![Static Badge](https://img.shields.io/badge/-Prompt-text?style=social&logo=github%20copilot) > > ```prompt - > Hey copilot, how can I create and publish a new Git branch? - > ``` - - > **Tip:** This is a simple example, but Copilot is great at providing more tailored commands that might involve loops, pattern matching, file modification, and more! Don't be afraid to ask Copilot for a suggestion. Just remember it is a suggestion and you should always verify it first to be safe. - -1. Copilot probably gave us a command like the following. Rather than manually modify it, let's respond back to tell Copilot to use a particular name. - - ```bash - git checkout -b {new_branch_name} - git push -u origin {new_branch_name} - ``` - - > ![Static Badge](https://img.shields.io/badge/-Prompt-text?style=social&logo=github%20copilot) - > - > ```prompt - > Awesome! Thanks, Copilot! Let's use the - > branch name "accelerate-with-copilot". + > Hey copilot, how can I create and publish a new Git branch called "accelerate-with-copilot"? > ``` > **Tip:** If Copilot doesn't give you quite what you want, you can always continue explaining what you need. Copilot will remember the conversation history for follow-up responses. diff --git a/.github/workflows/3-copilot-edits.yml b/.github/workflows/3-copilot-edits.yml index a9a2192..352f935 100644 --- a/.github/workflows/3-copilot-edits.yml +++ b/.github/workflows/3-copilot-edits.yml @@ -67,6 +67,16 @@ jobs: minimum-occurrences: 3 case-sensitive: false + - name: Check for participant info in styles.css + id: check-app-js + continue-on-error: true + uses: skills/action-keyphrase-checker@v1 + with: + text-file: src/static/styles.css + keyphrase: participant + minimum-occurrences: 1 + case-sensitive: false + - name: Update comment - step results uses: GrantBirki/comment@v2.1.1 with: @@ -80,6 +90,8 @@ jobs: results_table: - description: "Check app.js for participant info" passed: ${{ steps.check-app-js.outcome == 'success' }} + - description: "Check styles.css for participant info" + passed: ${{ steps.check-styles-css.outcome == 'success' }} - name: Fail job if not all checks passed if: contains(steps.*.outcome, 'failure') @@ -90,7 +102,8 @@ jobs: needs: [find_exercise, check_step_work] runs-on: ubuntu-latest env: - ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} steps: - name: Checkout @@ -130,6 +143,5 @@ jobs: run: | gh workflow disable "${{github.workflow}}" gh workflow enable "Step 4" - gh workflow enable "Step 4b" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/4b-copilot-on-github.yml b/.github/workflows/4b-copilot-on-github.yml deleted file mode 100644 index e0d84e0..0000000 --- a/.github/workflows/4b-copilot-on-github.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Step 4b # Copilot on GitHub - -on: - # Trigger if PR Description is edited - # Disabled because PR summaries are not available for free accounts - # pull_request: - # branches: - # - main - # types: - # - edited - - # Trigger if Copilot adds a review comment - pull_request_review: - -permissions: - contents: write - actions: write - issues: write - pull-requests: read - repository-projects: read - -jobs: - find_exercise: - name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main - - check_step_work: - name: Check step work - runs-on: ubuntu-latest - needs: [find_exercise] - env: - ISSUE_REPOSITORY: ${{ github.repository }} - ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Get response templates - uses: actions/checkout@v4 - with: - repository: skills/exercise-toolkit - path: exercise-toolkit - ref: main - - # START: Check practical exercise - - - name: Check for PR description - continue-on-error: true - id: check-pr-description - run: | - # Check if PR has a description and minimum length - min_length=15 - body_length=$(echo "$PR_Body" | wc -c) - echo "PR description length: $body_length" - - if [ "$body_length" -lt $min_length ]; then - echo "::error::PR description is too short or missing" - exit 1 - fi - env: - PR_Body: ${{ github.event.pull_request.body }} - - - name: Check for Copilot review - continue-on-error: true - id: check-copilot-review - run: | - # Check for a PR Review from Copilot - reviews=$(gh pr view --repo $REPO $PR_NUMBER --json reviews) - authors=$(echo "$reviews" | jq '.reviews[].author.login') - - if echo "$authors" | grep -q "copilot-pull-request-reviewer"; then - echo "Copilot has reviewed this PR." - else - echo "Copilot has NOT reviewed this PR." - echo "::error::No review from Copilot found" - exit 1 - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - PR_NUMBER: ${{ github.event.pull_request.number }} - - - name: Create comment - step results - uses: GrantBirki/comment@v2.1.1 - with: - repository: ${{ env.ISSUE_REPOSITORY }} - issue-number: ${{ env.ISSUE_NUMBER }} - file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md - vars: | - step_number: 4 - results_table: - - description: "Pull request contains a descriptive overview" - passed: ${{ steps.check-pr-description.outcome == 'success' }} - - description: "Pull request received a review from GitHub Copilot" - passed: ${{ steps.check-copilot-review.outcome == 'success' }} - tips: - - "If you already requested Copilot review and this check did not pass, go to your repository [actions](https://github.com/${{ github.repository }}/actions) tab to check if a workflow run is awaiting your manual approval." - - "You can use repository rulesets to automatically require a review from Copilot." - - - name: Fail job if not all checks passed - if: contains(steps.*.outcome, 'failure') - run: exit 1 - - # END: Check practical exercise From 078d3d1bdc689723c75f15835ecda1d3e34c5dc7 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 09:27:22 +0000 Subject: [PATCH 05/11] Point to github learn for more skills --- .github/steps/x-review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/steps/x-review.md b/.github/steps/x-review.md index 8a40adc..519940a 100644 --- a/.github/steps/x-review.md +++ b/.github/steps/x-review.md @@ -18,7 +18,7 @@ Here's a recap of your accomplishments: - Use Copilot to fix issues found during a pull request review. - Use Copilot to generate tests and documentation. - Use Copilot with different models. -- Check out the other [GitHub Skills exercises](https://skills.github.com). +- Check out the other [GitHub Skills exercises](https://learn.github.com/skills). - Learn how to [Integrate MCP with Copilot](https://github.com/skills/integrate-mcp-with-copilot) - Try GitHub Copilot Coding Agent in the [Expand your team with Copilot](https://github.com/skills/expand-your-team-with-copilot) exercise From e2c842943176cb4c9d245fe130407f3f534de2d6 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 09:57:03 +0000 Subject: [PATCH 06/11] Remove step4b workflow since it never runs --- .github/workflows/4b-copilot-on-github.yml | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/4b-copilot-on-github.yml diff --git a/.github/workflows/4b-copilot-on-github.yml b/.github/workflows/4b-copilot-on-github.yml new file mode 100644 index 0000000..c68271b --- /dev/null +++ b/.github/workflows/4b-copilot-on-github.yml @@ -0,0 +1,105 @@ +name: Step 4b # Copilot on GitHub + +on: + # Trigger if PR Description is edited + # Disabled because PR summaries are not available for free accounts + # pull_request: + # branches: + # - main + # types: + # - edited + + # Trigger if Copilot adds a review comment + pull_request_review: + +permissions: + contents: write + actions: write + issues: write + pull-requests: read + repository-projects: read + +jobs: + find_exercise: + name: Find Exercise Issue + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 + + check_step_work: + name: Check step work + runs-on: ubuntu-latest + needs: [find_exercise] + env: + ISSUE_REPOSITORY: ${{ github.repository }} + ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get response templates + uses: actions/checkout@v4 + with: + repository: skills/exercise-toolkit + path: exercise-toolkit + ref: v0.7.0 + + # START: Check practical exercise + + - name: Check for PR description + continue-on-error: true + id: check-pr-description + run: | + # Check if PR has a description and minimum length + min_length=15 + body_length=$(echo "$PR_Body" | wc -c) + echo "PR description length: $body_length" + + if [ "$body_length" -lt $min_length ]; then + echo "::error::PR description is too short or missing" + exit 1 + fi + env: + PR_Body: ${{ github.event.pull_request.body }} + + - name: Check for Copilot review + continue-on-error: true + id: check-copilot-review + run: | + # Check for a PR Review from Copilot + reviews=$(gh pr view --repo $REPO $PR_NUMBER --json reviews) + authors=$(echo "$reviews" | jq '.reviews[].author.login') + + if echo "$authors" | grep -q "copilot-pull-request-reviewer"; then + echo "Copilot has reviewed this PR." + else + echo "Copilot has NOT reviewed this PR." + echo "::error::No review from Copilot found" + exit 1 + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + + - name: Create comment - step results + uses: GrantBirki/comment@v2.1.1 + with: + repository: ${{ env.ISSUE_REPOSITORY }} + issue-number: ${{ env.ISSUE_NUMBER }} + file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md + vars: | + step_number: 4 + results_table: + - description: "Pull request contains a descriptive overview" + passed: ${{ steps.check-pr-description.outcome == 'success' }} + - description: "Pull request received a review from GitHub Copilot" + passed: ${{ steps.check-copilot-review.outcome == 'success' }} + tips: + - "If you already requested Copilot review and this check did not pass, go to your repository [actions](https://github.com/${{ github.repository }}/actions) tab to check if a workflow run is awaiting your manual approval." + - "You can use repository rulesets to automatically require a review from Copilot." + + - name: Fail job if not all checks passed + if: contains(steps.*.outcome, 'failure') + run: exit 1 + + # END: Check practical exercise From 0a5b38ee2e9b7283855ea464ca333cb91ab6da6a Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 09:57:15 +0000 Subject: [PATCH 07/11] chore: bump all exercise-toolkit refs to v0.7.0 --- .github/workflows/0-start-exercise.yml | 4 ++-- .github/workflows/1-preparing.yml | 4 ++-- .github/workflows/2-first-introduction.yml | 6 +++--- .github/workflows/3-copilot-edits.yml | 6 +++--- .github/workflows/3b-copilot-agent-mode.yml | 2 +- .github/workflows/4-copilot-on-github.yml | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/0-start-exercise.yml b/.github/workflows/0-start-exercise.yml index 113678c..009158d 100644 --- a/.github/workflows/0-start-exercise.yml +++ b/.github/workflows/0-start-exercise.yml @@ -18,7 +18,7 @@ jobs: if: | !github.event.repository.is_template name: Start Exercise - uses: skills/exercise-toolkit/.github/workflows/start-exercise.yml@main + uses: skills/exercise-toolkit/.github/workflows/start-exercise.yml@v0.7.0 with: exercise-title: "Getting Started with GitHub Copilot" intro-message: "Welcome to the exciting world of GitHub Copilot! 🚀 In this exercise, you'll unlock the potential of this AI-powered coding assistant to accelerate your development process. Let's dive in and have some fun exploring the future of coding together! 💻✨" @@ -40,7 +40,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Create comment - add step content uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/1-preparing.yml b/.github/workflows/1-preparing.yml index 55f1d1b..1d4d9ee 100644 --- a/.github/workflows/1-preparing.yml +++ b/.github/workflows/1-preparing.yml @@ -16,7 +16,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 post_next_step_content: name: Post next step content @@ -35,7 +35,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Create comment - step finished uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/2-first-introduction.yml b/.github/workflows/2-first-introduction.yml index bad24b4..371740f 100644 --- a/.github/workflows/2-first-introduction.yml +++ b/.github/workflows/2-first-introduction.yml @@ -18,7 +18,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 check_step_work: name: Check step work @@ -37,7 +37,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Find last comment id: find-last-comment @@ -105,7 +105,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Create comment - step finished uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/3-copilot-edits.yml b/.github/workflows/3-copilot-edits.yml index 352f935..b613a7f 100644 --- a/.github/workflows/3-copilot-edits.yml +++ b/.github/workflows/3-copilot-edits.yml @@ -18,7 +18,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 check_step_work: name: Check step work @@ -38,7 +38,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Find last comment id: find-last-comment @@ -114,7 +114,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Create comment - step finished uses: GrantBirki/comment@v2.1.1 diff --git a/.github/workflows/3b-copilot-agent-mode.yml b/.github/workflows/3b-copilot-agent-mode.yml index bae702b..f531107 100644 --- a/.github/workflows/3b-copilot-agent-mode.yml +++ b/.github/workflows/3b-copilot-agent-mode.yml @@ -37,7 +37,7 @@ jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 post_next_step_content: name: Post next step content diff --git a/.github/workflows/4-copilot-on-github.yml b/.github/workflows/4-copilot-on-github.yml index 34ef5a7..1ab47a0 100644 --- a/.github/workflows/4-copilot-on-github.yml +++ b/.github/workflows/4-copilot-on-github.yml @@ -18,7 +18,7 @@ env: jobs: find_exercise: name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@main + uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 post_review_content: name: Post review content @@ -37,7 +37,7 @@ jobs: with: repository: skills/exercise-toolkit path: exercise-toolkit - ref: main + ref: v0.7.0 - name: Create comment - step finished - final review next uses: GrantBirki/comment@v2.1.1 @@ -61,7 +61,7 @@ jobs: finish_exercise: name: Finish Exercise needs: [find_exercise, post_review_content] - uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@main + uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.7.0 with: issue-url: ${{ needs.find_exercise.outputs.issue-url }} exercise-title: "Getting Started with GitHub Copilot" From a1f66a101ad40ec50be878427e6d68c530730204 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:07:39 +0000 Subject: [PATCH 08/11] remove step4b workflow --- .github/workflows/4b-copilot-on-github.yml | 105 --------------------- 1 file changed, 105 deletions(-) delete mode 100644 .github/workflows/4b-copilot-on-github.yml diff --git a/.github/workflows/4b-copilot-on-github.yml b/.github/workflows/4b-copilot-on-github.yml deleted file mode 100644 index c68271b..0000000 --- a/.github/workflows/4b-copilot-on-github.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Step 4b # Copilot on GitHub - -on: - # Trigger if PR Description is edited - # Disabled because PR summaries are not available for free accounts - # pull_request: - # branches: - # - main - # types: - # - edited - - # Trigger if Copilot adds a review comment - pull_request_review: - -permissions: - contents: write - actions: write - issues: write - pull-requests: read - repository-projects: read - -jobs: - find_exercise: - name: Find Exercise Issue - uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0 - - check_step_work: - name: Check step work - runs-on: ubuntu-latest - needs: [find_exercise] - env: - ISSUE_REPOSITORY: ${{ github.repository }} - ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Get response templates - uses: actions/checkout@v4 - with: - repository: skills/exercise-toolkit - path: exercise-toolkit - ref: v0.7.0 - - # START: Check practical exercise - - - name: Check for PR description - continue-on-error: true - id: check-pr-description - run: | - # Check if PR has a description and minimum length - min_length=15 - body_length=$(echo "$PR_Body" | wc -c) - echo "PR description length: $body_length" - - if [ "$body_length" -lt $min_length ]; then - echo "::error::PR description is too short or missing" - exit 1 - fi - env: - PR_Body: ${{ github.event.pull_request.body }} - - - name: Check for Copilot review - continue-on-error: true - id: check-copilot-review - run: | - # Check for a PR Review from Copilot - reviews=$(gh pr view --repo $REPO $PR_NUMBER --json reviews) - authors=$(echo "$reviews" | jq '.reviews[].author.login') - - if echo "$authors" | grep -q "copilot-pull-request-reviewer"; then - echo "Copilot has reviewed this PR." - else - echo "Copilot has NOT reviewed this PR." - echo "::error::No review from Copilot found" - exit 1 - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPO: ${{ github.repository }} - PR_NUMBER: ${{ github.event.pull_request.number }} - - - name: Create comment - step results - uses: GrantBirki/comment@v2.1.1 - with: - repository: ${{ env.ISSUE_REPOSITORY }} - issue-number: ${{ env.ISSUE_NUMBER }} - file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md - vars: | - step_number: 4 - results_table: - - description: "Pull request contains a descriptive overview" - passed: ${{ steps.check-pr-description.outcome == 'success' }} - - description: "Pull request received a review from GitHub Copilot" - passed: ${{ steps.check-copilot-review.outcome == 'success' }} - tips: - - "If you already requested Copilot review and this check did not pass, go to your repository [actions](https://github.com/${{ github.repository }}/actions) tab to check if a workflow run is awaiting your manual approval." - - "You can use repository rulesets to automatically require a review from Copilot." - - - name: Fail job if not all checks passed - if: contains(steps.*.outcome, 'failure') - run: exit 1 - - # END: Check practical exercise From 89f8d37d49b70db8357e87307a4f531f6f0abfec Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:33:40 +0000 Subject: [PATCH 09/11] Fix wrong step id --- .github/workflows/3-copilot-edits.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/3-copilot-edits.yml b/.github/workflows/3-copilot-edits.yml index b613a7f..5201906 100644 --- a/.github/workflows/3-copilot-edits.yml +++ b/.github/workflows/3-copilot-edits.yml @@ -28,7 +28,6 @@ jobs: ISSUE_REPOSITORY: ${{ github.repository }} ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }} - steps: - name: Checkout uses: actions/checkout@v4 @@ -68,7 +67,7 @@ jobs: case-sensitive: false - name: Check for participant info in styles.css - id: check-app-js + id: check-styles-css continue-on-error: true uses: skills/action-keyphrase-checker@v1 with: From fafb3ab56f77acd5be1e91ea62746292f87139c0 Mon Sep 17 00:00:00 2001 From: Aleksander Fidelus <63016446+FidelusAleksander@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:42:44 +0000 Subject: [PATCH 10/11] Reword step4 about optional steps --- .github/steps/4-copilot-on-github.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/steps/4-copilot-on-github.md b/.github/steps/4-copilot-on-github.md index c0fcb69..7c6a772 100644 --- a/.github/steps/4-copilot-on-github.md +++ b/.github/steps/4-copilot-on-github.md @@ -6,19 +6,19 @@ Congratulations! You are finished with coding for this exercise (and VS Code). N Typically, you would review your notes and commit messages then summarize them for your pull request description. This may take some time, especially if commit messages are inconsistent or code is not documented well. Fortunately, Copilot can consider all changes in the pull request and provide the important highlights, and with references too! -> [!NOTE] +> [!NOTE] > This feature is not available in **GitHub Copilot Free**. [[docs]](https://docs.github.com/en/enterprise-cloud@latest/copilot/using-github-copilot/using-github-copilot-for-pull-requests/creating-a-pull-request-summary-with-github-copilot) #### Copilot code review More eyes on our work is always useful so let's ask Copilot to do a first pass before we do a normal peer review process. Copilot is great at catching common mistakes that are fixed by simple adjustments, but please remember to use it responsibly. -> [!NOTE] +> [!NOTE] > This feature is not available in **GitHub Copilot Free**. [[docs]](https://docs.github.com/en/copilot/using-github-copilot/code-review/using-copilot-code-review) ### :keyboard: Activity: Summarize and review a PR with Copilot -Both **Copilot pull request summaries** and **Copilot code review** have limited access, so this activity is mostly optional. If you have access, Mona will gladly check your work though! If not, you can skip the optional steps. +Both **Copilot pull request summaries** and **Copilot code review** have limited access, so this activity is mostly optional. If you have access, go ahead and try them though! If not, you can skip the optional steps. 1. In a web browser, open another tab and navigate to your exercise repository. From f9d2165ff45516979e54f5a4ef821efb8fcc15be Mon Sep 17 00:00:00 2001 From: "Christopher W. Blake" Date: Sat, 5 Jul 2025 11:59:43 +0900 Subject: [PATCH 11/11] Minor tweaks and whitespace cleanup. --- .github/steps/1-preparing.md | 2 +- .github/workflows/2-first-introduction.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/steps/1-preparing.md b/.github/steps/1-preparing.md index 0b43377..6c55e2a 100644 --- a/.github/steps/1-preparing.md +++ b/.github/steps/1-preparing.md @@ -103,7 +103,7 @@ Great work! Now that we are familiar with the app and we know it works, let's as > **Tip:** If Copilot doesn't give you quite what you want, you can always continue explaining what you need. Copilot will remember the conversation history for follow-up responses. -1. Now that we are happy with the command, press the `Run` button to let Copilot run it for us. No need to copy and paste! +1. Press the `Run` button to let Copilot insert the terminal command for us. No need to copy and paste! 1. After a moment, look in the VS Code lower status bar, on the left, to see the active branch. It should now say `accelerate-with-copilot`. If so, you are all done with this step! diff --git a/.github/workflows/2-first-introduction.yml b/.github/workflows/2-first-introduction.yml index 371740f..d00e25e 100644 --- a/.github/workflows/2-first-introduction.yml +++ b/.github/workflows/2-first-introduction.yml @@ -131,7 +131,6 @@ jobs: issue-number: ${{ env.ISSUE_NUMBER }} file: exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md - - name: Disable current workflow and enable next one run: | gh workflow disable "${{github.workflow}}"