feat: comment out actions we cant run atm #4
This file contains 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: "comment-on-pr" | |
on: [pull_request, push] | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm install | |
- name: Start the server | |
run: npm run build && npm run start & | |
env: | |
NODE_ENV: development | |
- name: Run Cypress tests | |
run: npx cypress run --e2e | |
env: | |
CI: true | |
# - name: Archive screenshots | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: cypress-screenshots | |
# path: cypress/screenshots | |
post-cypress: | |
needs: cypress-run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# - name: Download screenshots | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: cypress-screenshots | |
# path: ./screenshots | |
- name: Create comment with screenshots | |
run: | | |
for file in ./screenshots/**/*; do | |
echo "![Screenshot](https://github.com/${{ github.repository }}/raw/${{ github.sha }}/$file)" >> comment.md | |
done | |
gh pr comment ${{ github.event.pull_request.number }} --body "$(cat comment.md)" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |