Skip to content

Commit de3a070

Browse files
authored
Merge pull request #6482 from vector-im/feature/bma/check_towncrier
Add GitHub action to check for a towncrier file
2 parents 5a37838 + d524f1a commit de3a070

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

.github/workflows/quality.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Run code quality check suite
2222
run: ./tools/check/check_code_quality.sh
2323

24-
# Knit for all the modules (https://github.com/Kotlin/kotlinx-knit)
24+
# Knit for all the modules (https://github.com/Kotlin/kotlinx-knit)
2525
knit:
2626
name: Knit
2727
runs-on: ubuntu-latest
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
./gradlew knit
3333
34-
# ktlint for all the modules
34+
# ktlint for all the modules
3535
ktlint:
3636
name: Kotlin Linter
3737
runs-on: ubuntu-latest
@@ -104,7 +104,7 @@ jobs:
104104
comment_id: ${{ steps.fc.outputs.comment-id }}
105105
})
106106
107-
# Gradle dependency analysis using https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin
107+
# Gradle dependency analysis using https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin
108108
dependency-analysis:
109109
name: Dependency analysis
110110
runs-on: ubuntu-latest
@@ -123,7 +123,7 @@ jobs:
123123
name: dependency-analysis
124124
path: build/reports/dependency-check-report.html
125125

126-
# Lint for main module
126+
# Lint for main module
127127
android-lint:
128128
name: Android Linter
129129
runs-on: ubuntu-latest
@@ -151,7 +151,7 @@ jobs:
151151
path: |
152152
vector/build/reports/*.*
153153
154-
# Lint for Gplay and Fdroid release APK
154+
# Lint for Gplay and Fdroid release APK
155155
apk-lint:
156156
name: Lint APK (${{ matrix.target }})
157157
runs-on: ubuntu-latest
@@ -203,3 +203,26 @@ jobs:
203203
name: detekt-report
204204
path: |
205205
*/build/reports/detekt/detekt.html
206+
207+
towncrier:
208+
name: Towncrier check
209+
runs-on: ubuntu-latest
210+
if: github.event_name == 'pull_request' && github.head_ref == 'develop'
211+
steps:
212+
- uses: actions/checkout@v3
213+
- name: Set up Python 3.8
214+
uses: actions/setup-python@v4
215+
with:
216+
python-version: 3.8
217+
- name: Install towncrier
218+
run: |
219+
python3 -m pip install towncrier
220+
- name: Run towncrier
221+
# Fetch the pull request' base branch so towncrier will be able to
222+
# compare the current branch with the base branch.
223+
# Source: https://github.com/actions/checkout/#fetch-all-branches.
224+
run: |
225+
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
226+
towncrier check --compare-with origin/${BASE_BRANCH}
227+
env:
228+
BASE_BRANCH: ${{ github.base_ref }}

0 commit comments

Comments
 (0)