Skip to content

Commit

Permalink
Add automatically labels to pull requests based on the changed file p…
Browse files Browse the repository at this point in the history
…aths (#229)

## Description
Finding pull requests with GitHub can be hard. Especially when our app has a bug and we try to find the pull request which caused the bug, might it be helpful to labels, like `platform: android` when we know it something with the Android build or changes to our CI/CD with the label `ci/cd`.

Therefore, I added the `labeler` Action to automatically add labels to our pull requests based on the changed file paths.
  • Loading branch information
nilsreichardt authored May 17, 2022
1 parent 2dbcf67 commit f4b7443
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt)
# Licensed under the EUPL-1.2-or-later.
#
# You may obtain a copy of the Licence at:
# https://joinup.ec.europa.eu/software/page/eupl
#
# SPDX-License-Identifier: EUPL-1.2

"ci/cd":
- .github/workflows/**
- .github/labeler.yml

"documentation":
- '**/*.md'

"testing":
- "**/*_test.dart"

"platform: android":
- 'app/android/**'

"platform: ios":
- 'app/ios/**'

"platform: macos":
- 'app/macos/**'

"platform: web":
- 'app/web/**'
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ env:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow applies labels to pull requests based on the paths that are
# modified in the pull request.
#
# Edit `.github/labeler.yml` to configure labels.
#
# For more information, see: https://github.com/actions/labeler
label-pr:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Label PR
uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

analyze:
runs-on: ubuntu-latest
# In draft PRs we might use TODOs temporarily.
Expand Down

0 comments on commit f4b7443

Please sign in to comment.