Fixed vulnerabilities reported in GitHub #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish TS dev version to NPM on push to develop | |
on: | |
push: | |
branches: | |
- develop | |
paths: | |
- src/ts/** | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
########################################### | |
# CONFIG AND SETUP | |
########################################### | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
token: ${{ secrets.REPO_PUSH_PAT }} | |
- name: Setup user | |
run: | | |
git config --global user.email "martin.ashton@vimaec.com" | |
git config --global user.name "vim-format robot" | |
- name: Pull changes from remote | |
run: git pull origin develop | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies and build | |
run: npm ci && npm run build | |
working-directory: ./src/ts | |
- name: Run tests | |
run: npm test | |
working-directory: ./src/ts | |
- name: Get current version | |
run: echo "CURRENT_VERSION=$(npm version --json | jq -r '.version')" >> $GITHUB_ENV | |
working-directory: ./src/ts | |
- name: Bump dev version | |
run: echo "NEW_VERSION=$(npm --no-git-tag-version version prerelease --preid=dev | cut -c 2-)" >> $GITHUB_ENV | |
working-directory: ./src/ts | |
- name: Commit version bump | |
# NOTE: "[skip ci]" prevents loops https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs | |
run: git commit -am "[skip ci] Bump version to $NEW_VERSION" | |
- name: Push changes | |
run: git push | |
- name: Publish dev package on NPM 📦 | |
run: npm publish --tag=dev | |
working-directory: ./src/ts | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.VIM_NPM_PUSH }} |