Skip to content

BNGP-5039 Random reference string intermittently undefined in github workflow #4605

BNGP-5039 Random reference string intermittently undefined in github workflow

BNGP-5039 Random reference string intermittently undefined in github workflow #4605

Workflow file for this run

on:
push:
branches:
- master
- develop
pull_request:
types: [opened, synchronize, reopened]
name: Main Workflow
jobs:
tests:
name: tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies and local symlink dependencies
run: npm i
- name: Run markdown linting check
run: |
node_modules/.bin/markdownlint $PWD/README.md '$PWD/!(docker)/**/*.md'
- name: Add azure_services to hosts
run: |
sudo echo "127.0.0.1 azure_services" | sudo tee -a /etc/hosts
- name: Do not use a Postgres data volume
run: |
sed -i "s/- .\/volumes\/postgis/#- . \/volumes\/postgis/" docker/infrastructure.yml
- name: Run tests
run: npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.coverage.exclusions=**/connectors-lib/src/azure-service-bus-connector.js
new-version:
name: new-version
runs-on: ubuntu-latest
needs: tests
if: ${{ github.event_name == 'push' }}
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Install NodeJS
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: Install dependencies
run: npm ci
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Run versioning script
run: . ./.github/scripts/version-and-publish.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
BRANCH: ${{ steps.extract_branch.outputs.branch }}
HUSKY: 0