Update credentials.yml #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Step 3 # Enable push protection | |
| on: | |
| push: | |
| paths: | |
| - credentials.yml | |
| 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/[email protected] | |
| check_step_work: | |
| name: Check if push protection is enabled | |
| needs: [find_exercise] | |
| 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/response-templates | |
| path: skills-response-templates | |
| - name: Update comment - checking work | |
| run: | | |
| gh issue comment "$ISSUE_URL" \ | |
| --body-file skills-response-templates/step-feedback/checking-work.md \ | |
| --edit-last | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # START: Check practical exercise | |
| # The fact that the file was updated is enough for now. | |
| # A more detailed check will be added later. | |
| # END: Check practical exercise | |
| - name: Create comment - step results | |
| run: | | |
| gh issue comment "$ISSUE_URL" \ | |
| --body "Excellent! 🛡️ Push protection is now enabled. Your repository is ready to block any accidental commits containing secrets." | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create comment - step finished - final review next | |
| run: | | |
| gh issue comment "$ISSUE_URL" \ | |
| --body-file skills-response-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 | |
| - name: Create comment - add step content | |
| run: | | |
| gh issue comment "$ISSUE_URL" \ | |
| --body-file "$REVIEW_FILE" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Enable next workflow | |
| run: | | |
| gh workflow disable "Step 3" || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| finish_exercise: | |
| name: Finish Exercise | |
| needs: [find_exercise, post_review_content] | |
| uses: skills/exercise-toolkit/.github/workflows/[email protected] | |
| with: | |
| issue-url: ${{ needs.find_exercise.outputs.issue-url }} |