Skip to content

make project open to contributions #42

make project open to contributions

make project open to contributions #42

Workflow file for this run

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: Check for Lint/Build Errors
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: "Linting or build errors detected. Please fix them and push again."
})
- name: If No Errors, Merge
if: success()
run: |
if [ -z "$(git diff --name-only ${{ github.sha }} ${{ github.event.before }})" ]; then
echo "No linting or build errors detected. Merging."
curl -X PUT \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/merge \
-d '{"commit_title": "You Rock Thank you for your contribution! One core maintainer will review your changes and merge them if they are approved."}'
fi