Documentation Synchronization Audit (opentelemetry.io) #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation Synchronization Audit (opentelemetry.io) | |
on: | |
schedule: | |
- cron: "30 1 * * *" # daily at 1:30 UTC | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
crawl: | |
runs-on: ubuntu-latest | |
outputs: | |
audit-output: ${{ steps.audit.outputs.AUDIT_OUTPUT }} | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Set up gradle | |
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3 | |
- 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 }} |