Skip to content

Publish to Azure Pipeline Extension #48

Publish to Azure Pipeline Extension

Publish to Azure Pipeline Extension #48

name: Publish to Azure Pipeline Extension
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Run without publishing'
required: true
default: 'false'
type: boolean
jobs:
security-scan:
name: Security Scan
uses: ./.github/workflows/reusable.securityscan.workflow.yml
with:
working-directory: ./integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task
project-type: nodejs
fail-level: moderate
enable-snyk: false # Disable Snyk since we don't have a token
enable-ossar: true
enable-dependency-review: true
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Extract version from package.json
id: extract-version
working-directory: ./integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
generate-and-upload-sbom:
needs: [security-scan, get-version]
uses: ./.github/workflows/reusable.sbom.workflow.yml
with:
working-directory: ./integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task
project-name: ksm-extension-azure-pipeline
project-type: nodejs
project-version: ${{ needs.get-version.outputs.version }}
sbom-format: spdx-json
additional-labels: azure-pipeline,extension,security
secrets:
MANIFEST_TOKEN: ${{ secrets.MANIFEST_TOKEN }}
publish-az-pipeline-ext:
needs: generate-and-upload-sbom
if: success() && github.event.inputs.dry_run != 'true'
environment: prod
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./integration/keeper_secrets_manager_azure_pipeline_extension
steps:
- name: Get the source code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: ./integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task/package-lock.json
- name: Retrieve secrets from KSM
id: ksmsecrets
uses: Keeper-Security/ksm-action@master
with:
keeper-secret-config: ${{ secrets.KSM_AZ_PIPELINE_PUBSLISHER_CONFIG }}
secrets: |
DJz3ilHBHIbIZqkTClDV5Q/field/password > PAT
- name: Build
working-directory: ./integration/keeper_secrets_manager_azure_pipeline_extension/ksm-azure-devops-secrets-task
run: |
npm install
npm run build
- name: Publish
if: github.event.inputs.dry_run != 'true'
working-directory: ./integration/keeper_secrets_manager_azure_pipeline_extension
run: |
npm install -g tfx-cli
tfx extension publish --token ${{ steps.ksmsecrets.outputs.PAT }}
ls -lh *.vsix