Skip to content

Bump stylelint from 16.6.1 to 16.8.2 #301

Bump stylelint from 16.6.1 to 16.8.2

Bump stylelint from 16.6.1 to 16.8.2 #301

Workflow file for this run

on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm test
release:
needs: test
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Establish version
run: |
LOCAL=$(node -p "require('./package.json').version")
echo "local=${LOCAL}" >> $GITHUB_OUTPUT
echo "remote=$(npm view stylelint-config-gds version)" >> $GITHUB_OUTPUT
if git ls-remote --tags --exit-code origin ${LOCAL}; then
echo "tagged=yes" >> $GITHUB_OUTPUT
fi
id: version
- name: Tag version
if: ${{ steps.version.outputs.tagged != 'yes' }}
run: git tag ${{ steps.version.outputs.local }} && git push --tags
- name: Release to NPM
if: ${{ steps.version.outputs.local != steps.version.outputs.remote }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.ALPHAGOV_NPM_AUTOMATION_TOKEN }}