Skip to content

Add Actions workflow to check commons for breaking changes #5

Add Actions workflow to check commons for breaking changes

Add Actions workflow to check commons for breaking changes #5

name: Check Breaking Changes in Commons
on:
pull_request:
branches:
- main
env:
COMMONS_DIR: ../commons
jobs:
check-breaking-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout eslint-plugin-commons
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies for eslint-plugin-commons
run: pnpm install
- name: Package eslint-plugin-commons
run: |
PACKAGE_PATH=$(pnpm pack | tail -n 1)
echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV
- name: Checkout commons repository
uses: actions/checkout@v4
with:
repository: api3dao/commons
path: ${{ env.COMMONS_DIR }}
- name: Install packaged version in commons
working-directory: ${{ env.COMMONS_DIR }}
run: |
pnpm add -D file:../${{ env.PACKAGE_PATH }}
- name: Run ESLint on commons
working-directory: ${{ env.COMMONS_DIR }}
run: pnpm eslint .