Validate Android Release Notes #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: Validate Android Release Notes | |
| on: | |
| workflow_dispatch: # Enables manual trigger | |
| pull_request: | |
| paths: | |
| - 'android_beta/*.yml' | |
| - 'android_release/*.yml' | |
| push: | |
| paths: | |
| - 'android_beta/*.yml' | |
| - 'android_release/*.yml' | |
| jobs: | |
| render_notes: | |
| name: Render notes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| path: notes | |
| - name: Python requirements | |
| run: | | |
| pip install requests pyyaml jinja2 | |
| - name: Validate Notes | |
| shell: bash | |
| working-directory: notes | |
| env: | |
| BASE_REF: ${{ github.event.pull_request.base.ref }} | |
| run: | | |
| echo "BASE_REF=${BASE_REF}" | |
| BETA_FILES=$(git diff --name-only origin/$BASE_REF $GITHUB_SHA | grep ^android_beta || true ) | |
| for file in $BETA_FILES | |
| do | |
| echo "## $file" | tee -a $GITHUB_STEP_SUMMARY | |
| BETA_NUMBER=$(yq '.release.groups | length' $file) | |
| RELEASE_NUMBER=$(echo $file | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/') | |
| echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY | |
| python ./tools/android_notes_length.py ${RELEASE_NUMBER}b${BETA_NUMBER} | tee -a $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY | |
| done | |
| RELEASE_FILES=$(git diff --name-only origin/$BASE_REF $GITHUB_SHA | grep ^android_release || true ) | |
| for file in $RELEASE_FILES | |
| do | |
| echo "## $file" | tee -a $GITHUB_STEP_SUMMARY | |
| RELEASE_NUMBER=$(echo $file | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/') | |
| echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY | |
| python ./tools/android_notes_length.py ${RELEASE_NUMBER} | tee -a $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY | |
| done |