Skip to content

Update README examples to use v4 #41

Update README examples to use v4

Update README examples to use v4 #41

Workflow file for this run

name: Compile and push dist file
on: [push, pull_request]
jobs:
compile-and-push:
runs-on: ubuntu-latest
steps:
- if: github.event_name != 'pull_request'
uses: actions/checkout@v4
- if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Compile with ncc
run: |
npm install
npx ncc build src/index.ts -o dist
- name: Push
env:
DIR: dist
run: |
if git diff --exit-code $DIR
then
exit 0
fi
git config user.name github-actions
git config user.email github-actions@github.com
git add $DIR/*
git commit -m "Update dist/index.js"
git push