Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/watch-lintdiff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Use ~ to sort the workflow to the bottom of the list

Check failure on line 1 in .github/workflows/watch-lintdiff.yaml

View workflow job for this annotation

GitHub Actions / Protected Files

File '.github/workflows/watch-lintdiff.yaml' should only be updated by the Azure SDK team. If intentional, the PR may be merged by the Azure SDK team via bypassing the branch protections.
name: "~Watch - LintDiff"

on:
check_run:
types: completed

workflow_run:
types: completed
workflows:
- "\\[TEST-IGNORE\\] Swagger LintDiff"

permissions:
checks: write

jobs:
check-lintdiff:
runs-on: ubuntu-24.04
# TODO: Only run if check_run or workflow_run is initiated by pull_request

steps:
# *** IMPORTANT ***
# For workflows that are triggered by the pull_request_target event, the workflow runs in the
# context of the base of the pull request. You should make sure that you do not check out,
# build, or run untrusted code from the head of the pull request.
- uses: actions/checkout@v4
with:
# Only needs .github folder for automation, not the files in the PR (analyzed in a
# separate workflow).
#
# Uses the .github folder from the PR base branch (pull_request_target trigger),
# or the repo default branch (other triggers).
sparse-checkout: |
.github

- name: Verify Workflow Status
if: github.event_name == 'workflow_run'
uses: actions/github-script@v7
with:
script: |
console.log("Checking workflow status");
console.log(JSON.stringify(context.payload));
console.log(`State: ${context.payload.workflow_run.conclusion}`);

// Get status of check run named "Swagger LintDiff"
const checkRunName = "Swagger LintDiff";
// TODO: Paginate
const checkRuns = await github.rest.checks.listForRef({
...context.repo,
ref: context.payload.workflow_run.head_sha,
check_name: checkRunName,
status: "completed",
});

console.log("Check runs:");
console.log(JSON.stringify(checkRuns.data.check_runs, null, 2));

- name: Verify Check Run Status
if: github.event_name == 'check_run'
uses: actions/github-script@v7
with:
script: |
console.log("Checking check status")
console.log(JSON.stringify(context.payload));
console.log(`State: ${context.payload.check_run.conclusion}`);

// Get status of the workflow run named "[TEST-IGNORE] Swagger LintDiff"
const workflowRunName = "[TEST-IGNORE] Swagger LintDiff";
// TODO: Paginate
const workflowRuns = await github.rest.actions.listWorkflowRunsForRepo({
...context.repo,
head_sha: context.payload.check_run.head_sha,
status: "completed",
});

console.log("Workflow runs:");
console.log(JSON.stringify(workflowRuns.data.workflow_runs, null, 2));


Loading