-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocumentation-synchronization-audit.yml
More file actions
55 lines (47 loc) · 1.74 KB
/
documentation-synchronization-audit.yml
File metadata and controls
55 lines (47 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Documentation Synchronization Audit (opentelemetry.io)
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
crawl:
runs-on: ubuntu-latest
outputs:
audit-output: ${{ steps.audit.outputs.AUDIT_OUTPUT }}
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: temurin
java-version-file: .java-version
- name: Set up gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
- name: Run instrumentation analyzer (identify any module changes)
run: ./gradlew :instrumentation-docs:runAnalysis
- name: Run doc site audit
id: audit
run: |
if ! output=$(./gradlew :instrumentation-docs:docSiteAudit 2>&1); then
echo "AUDIT_FAILED=true" >> $GITHUB_OUTPUT
echo "AUDIT_OUTPUT<<EOF" >> $GITHUB_OUTPUT
# Extract only the content between our custom markers
echo "$output" | sed -n '/=== AUDIT_FAILURE_START ===/,/=== AUDIT_FAILURE_END ===/p' | \
sed '/=== AUDIT_FAILURE_START ===/d' | \
sed '/=== AUDIT_FAILURE_END ===/d' >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
exit 1
else
echo "AUDIT_FAILED=false" >> $GITHUB_OUTPUT
fi
workflow-notification:
permissions:
contents: read
issues: write
needs:
- crawl
if: always()
uses: ./.github/workflows/reusable-workflow-notification.yml
with:
success: ${{ needs.crawl.result == 'success' }}
failure-details: ${{ needs.crawl.outputs.audit-output }}