chore(deps): bump lodash from 4.17.21 to 4.17.23 in the npm_and_yarn group across 1 directory #16
Workflow file for this run
This file contains hidden or 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
| # This is a basic workflow to help you get started with Actions | |
| name: CI | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| # events but only for the master branch | |
| on: | |
| push: | |
| pull_request: | |
| branches: [ master ] | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| # This workflow contains a single job called "build" | |
| build: | |
| env: | |
| TAG: patch | |
| runs-on: ubuntu-latest | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v2 | |
| - shell: bash | |
| name: "Parse GIT Information" | |
| run: | | |
| declare -A TAGS_MAP | |
| TAGS_MAP=(["master"]="latest") | |
| BRANCH=$(echo ${GITHUB_REF} | sed -r "s/\/?refs\/heads\///g" | sed -r "s/\//\-/g") | |
| TAG=${TAGS_MAP[$BRANCH]} | |
| REPOSITORY=$(echo "${{ github.repository }}" | sed -r "s/\w*\///" | awk '{print tolower($0)}') | |
| REPOSITORY_PREFIX=$(echo "${{ github.repository }}" | awk '{print tolower($0)}') | |
| IMAGE=$(echo "${REPOSITORY_PREFIX}/${REPOSITORY}") | |
| if [ -d $TAG ]; then | |
| TAG=$BRANCH | |
| fi | |
| commit_message=$(git log --format=%B -n 1 ${{ github.sha }}) | |
| echo "MESSAGE<<EOF" >> $GITHUB_ENV | |
| echo "${commit_message}" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| echo "BRANCH=${BRANCH}" >> $GITHUB_ENV | |
| echo "IMAGE=${IMAGE}" >> $GITHUB_ENV | |
| echo "TAG=${TAG}" >> $GITHUB_ENV | |
| - name: "Should Build" | |
| if: env.BRANCH == 'master' || startsWith(env.MESSAGE, '[BUILD]') || github.head_ref != '' | |
| run: | | |
| BUILD=$(echo "1") | |
| NODE_ENV=$(echo "production") | |
| echo "BUILD=$BUILD" >> $GITHUB_ENV | |
| echo "NODE_ENV=$NODE_ENV" >> $GITHUB_ENV | |
| - name: "Fetch" | |
| if: env.BUILD == '1' | |
| run: git fetch --prune --unshallow | |
| - shell: bash | |
| name: "Generate new version" | |
| run: | | |
| regex='^bump\((minor|patch|major)\)' | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| if [[ $BRANCH == 'master' ]]; then | |
| if [[ $MESSAGE =~ $regex ]]; then | |
| npm version $(echo ${BASH_REMATCH[1]}) | |
| else | |
| npm version patch | |
| fi | |
| else | |
| npm version prerelease --preid=$(git log --pretty=format:'%h' -n 1) | |
| fi | |
| - shell: bash | |
| name: "Get Version name" | |
| if: env.BUILD == '1' | |
| id: version | |
| run: | | |
| version=$(git describe --always) | |
| echo "VERSION=$version" >> $GITHUB_ENV | |
| - uses: actions/setup-node@v1 | |
| if: env.BUILD == '1' | |
| with: | |
| node-version: '16.10.0' | |
| - name: "Setup registry" | |
| if: env.BUILD == '1' | |
| run: | | |
| echo "//npm.pkg.github.com/:_authToken=$NPM_TOKEN" > ~/.npmrc | |
| env: | |
| NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Install dependencies" | |
| if: env.BUILD == '1' | |
| run: | | |
| npm ci | |
| env: | |
| NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_ENV: development | |
| - run: npm publish --registry https://npm.pkg.github.com | |
| if: env.BUILD == '1' | |
| env: | |
| NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - shell: bash | |
| name: "Push New version" | |
| if: success() && github.ref == 'refs/heads/master' | |
| run: | | |
| git push origin --follow-tags |