[Snyk] Upgrade ziti-sdk-nodejs from 0.2.3 to 0.4.0 #8
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: Build | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'package.json' | |
- 'CHANGELOG.md' | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
inputs: | |
tags: | |
required: false | |
description: 'Misc tags' | |
jobs: | |
build: | |
name: 'Build' | |
runs-on: ubuntu-latest | |
env: | |
BUILD_NUMBER: ${{ github.run_number }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USER }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Extract PR number | |
shell: bash | |
run: | | |
echo "##[set-output name=pr_number;]$(echo $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH"))" | |
id: extract_pr_number | |
- name: Extract version number | |
shell: bash | |
run: | | |
echo "##[set-output name=version_number;]$(echo $(jq -r .version package.json))" | |
id: extract_version_number | |
- name: Build/Push (main) | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/openziti/ziti-gitlab-webhook:${{ github.run_number }} | |
ghcr.io/openziti/ziti-gitlab-webhook:latest | |
ghcr.io/openziti/ziti-gitlab-webhook:${{ steps.extract_version_number.outputs.version_number }} | |
if: | | |
steps.extract_branch.outputs.branch == 'main' | |
- name: Build/Push (PR) | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/openziti/ziti-gitlab-webhook:${{ github.run_number }} | |
ghcr.io/openziti/ziti-gitlab-webhook:PR${{ steps.extract_pr_number.outputs.pr_number }}.${{ github.run_number }} | |
if: | | |
steps.extract_branch.outputs.branch != 'main' | |