Skip to content

ComputeRP 2024-11-01 #605

ComputeRP 2024-11-01

ComputeRP 2024-11-01 #605

name: ARM Incremental TypeSpec (Preview)
on:
pull_request:
paths:
# Always trigger on changes to WF itself
- ".github/**"
# Only trigger if PR includes at least one non-example RM swagger, since this is only way WF can return "true"
# All consumers of workflow must treat "skipped" as equal to "completed false"
- "**/resource-manager/**/*.json"
- "!**/examples/**/*.json"
permissions:
contents: read
jobs:
arm-incremental-typespec-preview:
name: ARM Incremental TypeSpec (Preview)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
# Required to detect changed files in PR
fetch-depth: 2
# Check only needs to view contents of changed files as a string, so can use
# "git show" on specific files instead of cloning whole repo
sparse-checkout: |
.github
# Output is "true" if PR contains only incremental changes to an existing TypeSpec RP
- id: incremental-typespec
name: ARM Incremental TypeSpec (Preview)
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { default: incrementalTypeSpec } =
await import('${{ github.workspace }}/.github/workflows/src/arm-incremental-typespec-preview.js');
return await incrementalTypeSpec({ github, context, core });
- name: Upload artifact with results
uses: ./.github/actions/add-empty-artifact
with:
name: "incremental-typespec"
value: ${{ steps.incremental-typespec.outputs.result }}