Skip to content

XS✔ ◾ Message Filtering #2107

XS✔ ◾ Message Filtering

XS✔ ◾ Message Filtering #2107

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:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
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 }}
- name: Install Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22.x
- name: npm – Install Dependencies
run: npm install
- 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: ${{ steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Set Name
run: git config --global user.name "github-actions[bot]"
- if: ${{ 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: ${{ steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Commit Changed Files
run: git commit -m "Fixing linting, Updating dist folder"
- if: ${{ steps.detect-changes.outputs.NO_CHANGES_PRESENT == 'False' }}
name: Git – Push Changed Files
run: git push
build:
name: Build
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Install Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 22.x
- name: npm – Install Dependencies
run: npm install
- name: npm – Test Clean
run: npm run clean
- name: npm – Build
run: npm run build
- name: npm – Test
run: npm run test
- name: Release - Install TFX CLI
run: npm install -g tfx-cli
working-directory: ${{ github.workspace }}/release
- 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@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
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: {}
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Validate Markdown Links
uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # 1.0.15
with:
config-file: .github/linters/markdown-link-check.json
- name: Validate babel.config.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: babel.config.json
print-valid-files: true
strict: false
- name: Validate .markdownlint.json – Download .markdownlint.schema.json
shell: pwsh
run: Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json' -OutFile '.markdownlint.schema.json'
- name: Validate .markdownlint.json – Update .markdownlint.schema.json
shell: pwsh
run: |-
$FileContent = Get-Content -Path '.markdownlint.schema.json' -Raw
$FileContent = $FileContent -replace 'http://json-schema.org/draft-07/schema#', 'http://json-schema.org/draft-04/schema#'
Set-Content -NoNewline -Path '.markdownlint.schema.json' -Value $FileContent
- name: Validate .markdownlint.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: .markdownlint.json
print-valid-files: true
schema: .markdownlint.schema.json
strict: false
- name: Validate devcontainer.json – Download devcontainer.schema.json
shell: pwsh
run: Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/microsoft/vscode/main/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json' -OutFile 'devcontainer.schema.json'
- name: Validate devcontainer.json – Update devcontainer.schema.json
shell: pwsh
run: |-
$FileContent = Get-Content -Path 'devcontainer.schema.json' -Raw
$FileContent = $FileContent -replace 'http://json-schema.org/draft-07/schema#', 'http://json-schema.org/draft-04/schema#'
Set-Content -NoNewline -Path 'devcontainer.schema.json' -Value $FileContent
- name: Validate devcontainer.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: .devcontainer/devcontainer.json
print-valid-files: true
strict: false
schema: devcontainer.schema.json
- name: Validate vss-extension.json – Download vss-extension.schema.json
shell: pwsh
run: Invoke-WebRequest -Uri 'https://json.schemastore.org/vss-extension.json' -OutFile 'vss-extension.schema.json'
- name: Validate vss-extension.json – Update vss-extension.schema.json
shell: pwsh
run: |-
$FileContent = Get-Content -Path 'vss-extension.schema.json' -Raw
$FileContent = $FileContent -replace 'http://json-schema.org/draft-07/schema#', 'http://json-schema.org/draft-04/schema#'
Set-Content -NoNewline -Path 'vss-extension.schema.json' -Value $FileContent
- name: Validate vss-extension.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: src/vss-extension.json
print-valid-files: true
strict: false
schema: vss-extension.schema.json
- name: Validate task.json – Download task.schema.json
shell: pwsh
run: Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/microsoft/azure-pipelines-task-lib/master/tasks.schema.json' -OutFile 'task.schema.json'
- name: Validate task.json – Update task.schema.json
shell: pwsh
run: |-
$FileContent = Get-Content -Path 'task.schema.json' -Raw
$FileContent = $FileContent.replace('^connectedService\\:.+$', '^connectedService:.+$')
Set-Content -NoNewline -Path 'task.schema.json' -Value $FileContent
- name: Validate task.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: src/task/task.json
print-valid-files: true
schema: task.schema.json
- name: Validate task.loc.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: src/task/task.loc.json
print-valid-files: true
schema: task.schema.json
- name: Validate tsconfig.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: src/task/tsconfig.json
print-valid-files: true
strict: false
- name: Validate typedoc.json – Download typedoc.schema.json
shell: pwsh
run: Invoke-WebRequest -Uri 'https://typedoc.org/schema.json' -OutFile 'typedoc.schema.json'
- name: Validate typedoc.json – Update typedoc.schema.json
shell: pwsh
run: |-
$FileContent = Get-Content -Path 'typedoc.schema.json' -Raw
$FileContent = $FileContent -replace 'https://json-schema.org/draft-07/schema', 'http://json-schema.org/draft-04/schema#'
Set-Content -NoNewline -Path 'typedoc.schema.json' -Value $FileContent
- name: Validate typedoc.json
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: src/task/typedoc.json
print-valid-files: true
strict: false
schema: typedoc.schema.json
- name: Validate resources.resjson (en-US)
uses: walbo/validate-json@1c24a27a740a698944ff5b697cb8010a72c55c6b # v1.1.0
with:
files: src/task/Strings/resources.resjson/en-US/resources.resjson
print-valid-files: true
strict: false
validate-codeql:
name: Validate – CodeQL
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Initialize
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
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@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
category: TypeScript
validate-linter:
name: Validate – Linter
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Super Linter
uses: github/super-linter@4e51915f4a812abf59fed160bb14595c0a38a9e7 # v6
env:
EDITORCONFIG_FILE_NAME: ../../.editorconfig
FILTER_REGEX_EXCLUDE: .*dist/.*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_CONFIG_FILE: gitleaks.toml
MARKDOWN_CONFIG_FILE: ../../.markdownlint.json
TYPESCRIPT_ES_CONFIG_FILE: ../../.eslintrc.yml
VALIDATE_JAVASCRIPT_STANDARD: 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 }}
...