refactored gerber and excellon drill into circuit-json-to-gerber #76
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: Format PR | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
format: | |
name: Format code | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Determine if fork | |
id: check_fork | |
run: | | |
if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then | |
echo "is_fork=false" >> $GITHUB_OUTPUT | |
else | |
echo "is_fork=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
if: steps.check_fork.outputs.is_fork == 'false' | |
with: | |
token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
if: steps.check_fork.outputs.is_fork == 'false' | |
with: | |
node-version: "20" | |
- run: npm install | |
- name: Run formatter | |
if: steps.check_fork.outputs.is_fork == 'false' | |
run: npx prettier -w . | |
- name: Commit changes | |
if: steps.check_fork.outputs.is_fork == 'false' | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "formatbot: Automatically format code" | |
branch: ${{ github.head_ref }} | |
commit_user_name: tscircuitbot | |
commit_user_email: [email protected] | |
commit_author: tscircuitbot <[email protected]> |