mirror of
https://github.com/jlengrand/getting-started-with-github-copilot.git
synced 2026-03-10 08:21:18 +00:00
Initial commit
This commit is contained in:
66
.github/workflows/0-start-exercise.yml
vendored
Normal file
66
.github/workflows/0-start-exercise.yml
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
name: Step 0 # Start Exercise
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
STEP_1_FILE: ".github/steps/1-preparing.md"
|
||||
|
||||
jobs:
|
||||
start_exercise:
|
||||
if: |
|
||||
!github.event.repository.is_template
|
||||
name: Start Exercise
|
||||
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! 💻✨"
|
||||
|
||||
post_next_step_content:
|
||||
name: Post next step content
|
||||
runs-on: ubuntu-latest
|
||||
needs: [start_exercise]
|
||||
env:
|
||||
ISSUE_NUMBER: ${{ needs.start_exercise.outputs.issue-number }}
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.0
|
||||
|
||||
- name: Create comment - add step content
|
||||
uses: GrantBirki/comment@v2.1.1
|
||||
with:
|
||||
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 - watching for progress
|
||||
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: Enable next step workflow
|
||||
run: |
|
||||
gh workflow enable "Step 1"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
139
.github/workflows/1-preparing.yml
vendored
Normal file
139
.github/workflows/1-preparing.yml
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
name: Step 1
|
||||
|
||||
on:
|
||||
push:
|
||||
# Trigger on pushes to any branch except the protected `main` branch
|
||||
branches-ignore:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
STEP_2_FILE: ".github/steps/2-first-introduction.md"
|
||||
|
||||
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@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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
|
||||
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
|
||||
|
||||
- name: Check branch name is correct
|
||||
id: check-branch
|
||||
continue-on-error: true
|
||||
uses: skills/action-keyphrase-checker@v1
|
||||
with:
|
||||
# Check the branch ref directly
|
||||
text: ${{ github.ref }}
|
||||
keyphrase: accelerate-with-copilot
|
||||
case-sensitive: true
|
||||
minimum-occurrences: 1
|
||||
maximum-occurrences: 1
|
||||
|
||||
- name: Update comment - step results
|
||||
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 }}
|
||||
edit-mode: replace
|
||||
file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md
|
||||
vars: |
|
||||
step_number: 1
|
||||
results_table:
|
||||
- description: "Checked that branch name is accelerate-with-copilot"
|
||||
passed: ${{ steps.check-branch.outcome == 'success' }}
|
||||
|
||||
# END: Check practical exercise
|
||||
|
||||
- name: Fail job if check failed
|
||||
if: ${{ steps.check-branch.outcome != 'success' }}
|
||||
run: exit 1
|
||||
|
||||
post_next_step_content:
|
||||
name: Post next step content
|
||||
needs: [find_exercise, check_step_work]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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: 2
|
||||
|
||||
- name: Create comment - add step content
|
||||
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
|
||||
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 "${{github.workflow}}"
|
||||
gh workflow enable "Step 2"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
136
.github/workflows/2-first-introduction.yml
vendored
Normal file
136
.github/workflows/2-first-introduction.yml
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
name: Step 2
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "accelerate-with-copilot"
|
||||
paths:
|
||||
- "src/app.py"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
STEP_3_FILE: ".github/steps/3-copilot-edits.md"
|
||||
|
||||
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@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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
|
||||
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
|
||||
|
||||
- name: Check for additional student activities
|
||||
id: check-additional-activities
|
||||
continue-on-error: true
|
||||
uses: skills/action-keyphrase-checker@v1
|
||||
with:
|
||||
text-file: src/app.py
|
||||
keyphrase: '"description"'
|
||||
minimum-occurrences: 4
|
||||
case-sensitive: false
|
||||
|
||||
- name: Update comment - step results
|
||||
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 }}
|
||||
edit-mode: replace
|
||||
file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md
|
||||
vars: |
|
||||
step_number: 2
|
||||
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: Fail job if not all checks passed
|
||||
if: contains(steps.*.outcome, 'failure')
|
||||
run: exit 1
|
||||
|
||||
post_next_step_content:
|
||||
name: Post next step content
|
||||
needs: [find_exercise, check_step_work]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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
|
||||
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
|
||||
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 "${{github.workflow}}"
|
||||
gh workflow enable "Step 3"
|
||||
gh workflow enable "Step 3b"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
146
.github/workflows/3-copilot-edits.yml
vendored
Normal file
146
.github/workflows/3-copilot-edits.yml
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
name: Step 3
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "accelerate-with-copilot"
|
||||
paths:
|
||||
- "src/static/**"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
STEP_4_FILE: ".github/steps/4-copilot-agent-mode.md"
|
||||
|
||||
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@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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
|
||||
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
|
||||
continue-on-error: true
|
||||
uses: skills/action-keyphrase-checker@v1
|
||||
with:
|
||||
text-file: src/static/app.js
|
||||
keyphrase: participant
|
||||
minimum-occurrences: 3
|
||||
case-sensitive: false
|
||||
|
||||
- name: Check for participant info in styles.css
|
||||
id: check-styles-css
|
||||
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:
|
||||
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
|
||||
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')
|
||||
run: exit 1
|
||||
|
||||
post_next_step_content:
|
||||
name: Post next step content
|
||||
needs: [find_exercise, check_step_work]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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
|
||||
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
|
||||
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 "${{github.workflow}}"
|
||||
gh workflow enable "Step 4"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
148
.github/workflows/4-copilot-agent-mode.yml
vendored
Normal file
148
.github/workflows/4-copilot-agent-mode.yml
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
name: Step 4
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "accelerate-with-copilot"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
STEP_5_FILE: ".github/steps/5-copilot-on-github.md"
|
||||
|
||||
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@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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
|
||||
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
|
||||
|
||||
- name: Check for pytest keyphrase in requirements.txt
|
||||
id: check-for-pytest
|
||||
continue-on-error: true
|
||||
uses: skills/action-keyphrase-checker@v1
|
||||
with:
|
||||
text-file: requirements.txt
|
||||
keyphrase: pytest
|
||||
|
||||
- name: Check if tests directory exists
|
||||
id: check-tests-dir
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if find . -name "tests" -type d | grep -q .; then
|
||||
echo "Tests directory found"
|
||||
exit 0
|
||||
else
|
||||
echo "Tests directory not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Update comment - step results
|
||||
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 }}
|
||||
edit-mode: replace
|
||||
file: exercise-toolkit/markdown-templates/step-feedback/step-results-table.md
|
||||
vars: |
|
||||
step_number: 4
|
||||
results_table:
|
||||
- description: "Checked for pytest in requirements.txt"
|
||||
passed: ${{ steps.check-for-pytest.outcome == 'success' }}
|
||||
- description: "Checked if tests are added in a separate directory"
|
||||
passed: ${{ steps.check-tests-dir.outcome == 'success' }}
|
||||
|
||||
# END: Check practical exercise
|
||||
|
||||
- name: Fail job if not all checks passed
|
||||
if: contains(steps.*.outcome, 'failure')
|
||||
run: exit 1
|
||||
|
||||
post_next_step_content:
|
||||
name: Post next step content
|
||||
needs: [find_exercise, check_step_work]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.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: 5
|
||||
|
||||
- name: Create comment - add step content
|
||||
uses: GrantBirki/comment@v2.1.1
|
||||
with:
|
||||
repository: ${{ env.ISSUE_REPOSITORY }}
|
||||
issue-number: ${{ env.ISSUE_NUMBER }}
|
||||
file: ${{ env.STEP_5_FILE }}
|
||||
|
||||
- name: Create comment - watching for progress
|
||||
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 "${{github.workflow}}"
|
||||
gh workflow enable "Step 5"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
67
.github/workflows/5-copilot-on-github.yml
vendored
Normal file
67
.github/workflows/5-copilot-on-github.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
name: Step 5
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
types:
|
||||
- closed
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
issues: write
|
||||
|
||||
env:
|
||||
REVIEW_FILE: ".github/steps/x-review.md"
|
||||
|
||||
jobs:
|
||||
find_exercise:
|
||||
name: Find Exercise Issue
|
||||
uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.0
|
||||
|
||||
post_review_content:
|
||||
name: Post review content
|
||||
needs: [find_exercise]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ISSUE_REPOSITORY: ${{ github.repository }}
|
||||
ISSUE_NUMBER: ${{ needs.find_exercise.outputs.issue-number }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Get response templates
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: skills/exercise-toolkit
|
||||
path: exercise-toolkit
|
||||
ref: v0.7.0
|
||||
|
||||
- name: Create comment - step finished - final review next
|
||||
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: Create comment - add review content
|
||||
uses: GrantBirki/comment@v2.1.1
|
||||
with:
|
||||
repository: ${{ env.ISSUE_REPOSITORY }}
|
||||
issue-number: ${{ env.ISSUE_NUMBER }}
|
||||
file: ${{ env.REVIEW_FILE }}
|
||||
|
||||
- name: Disable current workflow
|
||||
run: gh workflow disable "${{github.workflow}}"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
finish_exercise:
|
||||
name: Finish Exercise
|
||||
needs: [find_exercise, post_review_content]
|
||||
uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.7.1
|
||||
with:
|
||||
issue-url: ${{ needs.find_exercise.outputs.issue-url }}
|
||||
exercise-title: "Getting Started with GitHub Copilot"
|
||||
Reference in New Issue
Block a user