Skip to content

XS✔ ◾ Release v1.7.7 #2725

XS✔ ◾ Release v1.7.7

XS✔ ◾ Release v1.7.7 #2725

Workflow file for this run

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
---
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
types:
- checks_requested
schedule:
- cron: 0 0 * * 1
workflow_dispatch: null
permissions: {}
jobs:
update-code:
name: Update Code
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- if: ${{ github.actor != 'dependabot[bot]' }}
name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.HEAD_REF }}
# Fine-grained Personal Access Token (PAT) with the following permissions for microsoft/PR-Metrics:
# - Read access to Metadata
# - Read and Write access to Code (aka Contents)
token: ${{ secrets.BUILD_UPDATE_CODE_CHECKOUT }}
- if: ${{ github.actor == 'dependabot[bot]' }}
name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20.17.0
- name: npm – Install Dependencies
run: npm ci
- name: npm – Lint
run: npm run lint
- name: npm – Build Package
run: npm run build:package
- name: Git – Add Changed Files
run: git add -A
- name: Detect Changes
id: detect-changes
shell: pwsh
run: |-
$GitStatus = git status
Write-Output -InputObject $GitStatus
$NoChangesPresent = $GitStatus.Contains("nothing to commit, working tree clean")
Write-Output -InputObject $NoChangesPresent
Write-Output -InputObject "NO_CHANGES_PRESENT=$NoChangesPresent" >> $Env:GITHUB_OUTPUT
- if: ${{ github.actor != 'dependabot[bot]' && steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Set Name
run: git config --global user.name "github-actions[bot]"
- if: ${{ github.actor != 'dependabot[bot]' && steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Set Email
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- if: ${{ github.actor != 'dependabot[bot]' && steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Commit Changed Files
run: git commit -m "Fixing linting, Updating dist folder"
- if: ${{ github.actor != 'dependabot[bot]' && steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Push Changed Files
run: git push
- if: ${{ github.actor == 'dependabot[bot]' && steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Request Manual Updates
shell: pwsh
run: |-
Write-Output -InputObject "::error::Code changes detected in the PR. Please update the PR using 'npm run lint && npm run build:package' to include the latest changes."
exit 1
build:
name: Build
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: 20.17.0
- name: npm – Install Dependencies
run: npm ci
- name: npm – Test Clean
run: npm run clean
- name: npm – Build
run: npm run build
- name: npm – Test
run: npm run test
- name: Release – Create
run: npx tfx-cli extension create --manifest-globs vss-extension.json --output-path ../ms-omex.PRMetrics.vsix
working-directory: ${{ github.workspace }}/release
- name: Release – Upload
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: PRMetrics
path: ${{ github.workspace }}/ms-omex.PRMetrics.vsix
test-github-action:
name: Test GitHub Action
runs-on: ubuntu-latest
permissions:
pull-requests: write
statuses: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: PR Metrics
uses: ./
env:
PR_METRICS_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file-matching-patterns: |
**/*
!dist/*
!package-lock.json
validate:
name: Validate
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Validate Markdown Links (Attempt 1)
id: linkspector-1
continue-on-error: true
uses: umbrelladocs/action-linkspector@874d01cae9fd488e3077b08952093235bd626977 # 1.3.7
with:
config_file: .github/linters/.linkspector.yml
- name: Validate Markdown Links (Attempt 2)
id: linkspector-2
if: steps.linkspector-1.outcome == 'failure'
continue-on-error: true
uses: umbrelladocs/action-linkspector@874d01cae9fd488e3077b08952093235bd626977 # 1.3.7
with:
config_file: .github/linters/.linkspector.yml
- name: Validate Markdown Links (Attempt 3)
id: linkspector-3
if: steps.linkspector-2.outcome == 'failure'
uses: umbrelladocs/action-linkspector@874d01cae9fd488e3077b08952093235bd626977 # 1.3.7
with:
config_file: .github/linters/.linkspector.yml
- name: Initialize
uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
with:
build-mode: none
config-file: .github/linters/codeql.yml
languages: javascript-typescript
queries: security-extended,security-and-quality
- name: Analyze
uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5
with:
category: TypeScript
validate-linter:
name: Validate – Linter
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Super Linter
uses: github/super-linter@b807e99ddd37e444d189cfd2c2ca1274d8ae8ef1 # v7
env:
EDITORCONFIG_FILE_NAME: ../../.editorconfig
FILTER_REGEX_EXCLUDE: .*dist/.*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_CONFIG_FILE: gitleaks.toml
MARKDOWN_CONFIG_FILE: ../../.markdownlint.json
VALIDATE_JSON: false
VALIDATE_TYPESCRIPT_ES: false
VALIDATE_TYPESCRIPT_STANDARD: false
dependabot:
if: ${{ github.actor == 'dependabot[bot]' }}
name: Dependabot
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable Auto-Merge
run: gh pr merge --auto --delete-branch --squash "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}