Merge pull request #14 from salman-ibrahim/salman-ibrahim-patch-3 #52
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: Build 👷🏻♂️ | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: npm install | |
- name: Lint code | |
run: npm run lint | |
- name: Build app | |
run: npm run build | |
- name: Checks Failed | |
if: failure() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.setFailed("Linting or build errors detected. Please fix them and push again.") | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: "⚠️ Looks like you missed something Linting or build errors detected. Please fix them and push again." | |
}) | |
- name: All Checks Passed | |
if: success() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: "Kudos! All checks passed. 🎉 Thanks for contributing to the project, one of our maintainers will review your changes soon." | |
}) |