Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 45 additions & 0 deletions .github/workflows/ops-build-publisher.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Publish OPS build report'

on:
workflow_run:
workflows: ['OPS build reporter']
types: [completed]

permissions:
actions: read
pull-requests: write
checks: write

jobs:
publish:
name: Publish OPS diagnostics and previews
if: >-
github.event.workflow_run.event == 'pull_request' &&
(github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure')
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ops-publish-${{ github.repository }}-${{ github.event.workflow_run.head_repository.id }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
steps:
- name: Harden Runner
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
with:
egress-policy: audit

- name: Download producer report
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ops-build-report
path: ${{ runner.temp }}/ops-build-report-download
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Publish validated report
uses: dotnet/docs-actions/ops-build-reporter/publish@main
Comment thread
BillWagner marked this conversation as resolved.
with:
repo_token: ${{ github.token }}
artifact_directory: ${{ runner.temp }}/ops-build-report-download
producer_workflow_file: .github/workflows/ops-build-reporter.yml
annotate_file_warnings: true
29 changes: 18 additions & 11 deletions .github/workflows/ops-build-reporter.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
name: 'OPS build reporter'

on:
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
statuses: read

jobs:
ops_build_reporter_job:
name: Add preview links and annotate files
report:
name: Collect OPS diagnostics and previews
runs-on: ubuntu-latest
permissions:
statuses: read
checks: write
pull-requests: write
timeout-minutes: 65
steps:
- name: Harden Runner
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
with:
egress-policy: audit

- uses: dotnet/docs-actions/ops-build-reporter@cdb3719bab6025f7621b04044094048f597b1ae0 # main
- name: Produce report artifacts
id: report
uses: dotnet/docs-actions/ops-build-reporter@main
Comment thread
BillWagner marked this conversation as resolved.
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
annotate_file_warnings: true
repo_token: ${{ github.token }}

- name: Upload report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: ops-build-report
path: ${{ steps.report.outputs.artifact_path }}
if-no-files-found: error
retention-days: 7
overwrite: true
Loading