Skip to content

@dephub/eslint-ts@1.0.1 #2

@dephub/eslint-ts@1.0.1

@dephub/eslint-ts@1.0.1 #2

Workflow file for this run

# Publishes the package to npm when a version tag (v*) is pushed.
# Skips publishing if the exact version already exists.
name: Publish Package to npmjs
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Check if version exists
id: version
run: |
LOCAL_VERSION=$(node -p "require('./package.json').version")
PACKAGE_NAME=$(node -p "require('./package.json').name")
if npm view $PACKAGE_NAME@$LOCAL_VERSION version >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
if: steps.version.outputs.exists == 'false'
run: pnpm install --frozen-lockfile
- name: Publish
if: steps.version.outputs.exists == 'false'
run: pnpm publish --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}