Skip to content

Add github app/azure keyvault auth helper #2369

Add github app/azure keyvault auth helper

Add github app/azure keyvault auth helper #2369

Workflow file for this run

name: PR
on:
pull_request:
branches: [main, v2]
push:
branches: [main, v2]
concurrency:
# For PRs, use the ref (branch) in the concurrency group so that new pushes cancel any old runs.
# For pushes to main, ideally we wouldn't set a concurrency group, but github actions doesn't
# support conditional blocks of settings, so we use the SHA so the "group" is unique.
group: ${{ github.workflow }}-${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2') && github.sha || github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
build:
strategy:
# Sometimes it can be helpful to see if a failure is specific to a particular environment
fail-fast: false
matrix:
include:
# node 22/npm 10 on ubuntu and windows
- os: ubuntu-latest
npm: 10
node: 22
- os: windows-latest
npm: 10
node: 22
# node 24/npm 11 on ubuntu and windows
- os: ubuntu-latest
npm: 11
node: 24
- os: windows-latest
npm: 11
node: 24
name: build (${{ matrix.os }}, node ${{ matrix.node }}, npm ${{ matrix.npm }})
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
cache: yarn
node-version: ${{ matrix.node }}
# Guarantee a predictable version of npm
- name: Install npm@${{ matrix.npm }}
run: npm install --global npm@${{ matrix.npm }}
- run: yarn --immutable
- run: yarn build --verbose
- run: yarn checkchange --verbose
- run: yarn format:check
if: matrix.os == 'ubuntu-latest' && matrix.node == 22
- run: yarn lint --verbose
if: matrix.os == 'ubuntu-latest' && matrix.node == 22
- run: yarn test --verbose
id: test
# See packageManager.ts comments...
- name: run specific tests in Windows bash
if: matrix.os == 'windows-latest'
shell: bash
run: yarn workspace beachball test packagePublish npmAuthEnvPassthrough
# For a few specific test failures, it can be helpful to see npm debug logs
# (usually not relevant, but there's not a good way to distinguish by specific failure)
- name: (on test failure) Get npm cache path
if: failure() && steps.test.outcome == 'failure'
shell: bash
run: echo "NPM_CACHE_DIR=$(npm config get cache)" >> "$GITHUB_ENV"
- name: (on test failure) Upload npm logs as artifact
if: failure() && steps.test.outcome == 'failure'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: npm-logs-${{ matrix.os }}-node${{ matrix.node }}-npm${{ matrix.npm }}
path: ${{ env.NPM_CACHE_DIR }}/_logs
retention-days: 3
actions:
name: test actions
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
cache: yarn
# This should match the node version from "runs: using:" in the action.yaml files
node-version: 24
- run: yarn --immutable
- run: yarn build --verbose
- name: Check for modified files
uses: ./actions/check-for-modified-files
with:
extraError: 'If action dist files changed, run "yarn build" and check in the updated dist files.'
- name: e2e - install-beachball
uses: ./actions/install-beachball
# Note: this is not actually used here to determine if a release is needed
- name: e2e - should-release
uses: ./actions/should-release
id: shouldRelease
with:
mode: output
token: ${{ github.token }}
batch: true
- name: e2e - should-release result
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const shouldRelease = '${{ steps.shouldRelease.outputs.shouldRelease }}';
if (shouldRelease !== 'yes' && shouldRelease !== 'no') {
core.setFailed(`should-release returned "${shouldRelease}" instead of "yes" or "no"`);
} else {
core.info(`should-release returned shouldRelease: "${shouldRelease}"`);
}
# The docs have a separate installation
docs:
name: build docs
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
cache: yarn
node-version-file: .nvmrc
- run: yarn --immutable
working-directory: ./docs
- run: yarn docs:build
working-directory: ./docs