Skip to content

Commit d656458

Browse files
coreycbkewisch
andauthored
Add simple validation for android release notes (#61)
* Add simple validation for android release notes * Use local script for validating android release notes --------- Co-authored-by: Philipp Kewisch <mozilla@kewis.ch>
1 parent 09e6bfc commit d656458

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/android.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'android_beta/*.yml'
7+
- 'android_release/*.yml'
8+
9+
jobs:
10+
render_notes:
11+
name: Render notes
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout this repo
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
path: notes
19+
20+
- name: Python requirements
21+
run: |
22+
pip install requests pyyaml jinja2
23+
24+
- name: Render Notes
25+
shell: bash
26+
working-directory: notes
27+
env:
28+
BASE_REF: ${{ github.event.pull_request.base.ref }}
29+
run: |
30+
BETA_FILES=$(git diff --name-only origin/$BASE_REF $GITHUB_SHA | grep ^android_beta || true )
31+
32+
for file in $BETA_FILES
33+
do
34+
echo "## $file" | tee -a $GITHUB_STEP_SUMMARY
35+
36+
BETA_NUMBER=$(yq '.release.groups | length' $file)
37+
RELEASE_NUMBER=$(echo $file | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/')
38+
39+
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
40+
python ./tools/android_notes_length.py ${RELEASE_NUMBER}b${BETA_NUMBER} | tee -a $GITHUB_STEP_SUMMARY
41+
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
42+
done
43+
44+
RELEASE_FILES=$(git diff --name-only origin/$BASE_REF $GITHUB_SHA | grep ^android_release || true )
45+
46+
for file in $RELEASE_FILES
47+
do
48+
echo "## $file" | tee -a $GITHUB_STEP_SUMMARY
49+
RELEASE_NUMBER=$(echo $file | sed -E 's/[^0-9]*([0-9]+\.[0-9]+).*/\1/')
50+
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
51+
python ./tools/android_notes_length.py ${RELEASE_NUMBER} | tee -a $GITHUB_STEP_SUMMARY
52+
echo "\`\`\`" | tee -a $GITHUB_STEP_SUMMARY
53+
done

0 commit comments

Comments
 (0)