Skip to content

Merge pull request #183 from MeasureAuthoringTool/MAT-5963/addExtraPr… #51

Merge pull request #183 from MeasureAuthoringTool/MAT-5963/addExtraPr…

Merge pull request #183 from MeasureAuthoringTool/MAT-5963/addExtraPr… #51

Workflow file for this run

name: npm-publish
on:
push:
branches:
- main
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./react
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v2-beta
with:
node-version: 14.x
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install node dependencies
run: npm ci
- name: Audit dependencies for security vulnerabilities
run: npm audit
- name: Lint the source code
run: npm run-script lint
- name: Check prettier formatting
run: npm run-script check-format
- name: Build the source code
run: npm run build
- name: Execute test coverage
run: npm run-script coverage
- name: Publish if version has been updated
env:
PUBLISH_COMMAND: npm
uses: pascalgn/npm-publish-action@master
with: # All of theses inputs are optional
tag_name: "v%s"
tag_message: "v%s"
commit_pattern: "[\\s\\S]*Release (\\S+)"
publish_args: " --access public"
workspace: "./react"
publish_command: "npm"
env: # More info about the environment variables in the README

Check failure on line 64 in .github/workflows/npm-publish.yml

View workflow run for this annotation

GitHub Actions / npm-publish

Invalid workflow file

The workflow is not valid. .github/workflows/npm-publish.yml (Line: 64, Col: 9): 'env' is already defined
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}