Skip to content

Commit

Permalink
Merge branch 'develop' into chore/update-pr-template
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich authored Aug 11, 2024
2 parents 583348f + 66b939d commit df9684f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
documentation:
- changed-files:
- any-glob-to-any-file: docs/**

client:
- changed-files:
- any-glob-to-any-file: webapp/**

application-server:
- changed-files:
- any-glob-to-any-file: server/application-server/**

intelligence-service:
- changed-files:
- any-glob-to-any-file: "server/intelligence-service/**"

feature:
- head-branch: ['^feature', 'feature', '^feat', 'feat']

bug:
- head-branch: ['^fix', 'fix', '^bug', 'bug']
56 changes: 56 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Pull Request Labeler"
on:
pull_request_target:

jobs:
labeler:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/labeler@v5
with:
configuration-path: .github/labeler.yml

- name: Calculate the PR size
uses: actions/github-script@v7
id: calculate-size
with:
script: |
const diff = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
mediaType: {
format: "diff",
},
});
const changedLines = diff.data
.split("\n")
.filter(line => line.startsWith('+') || line.startsWith('-'))
.length;
let label = '';
if (changedLines > 1000) label = 'size:XXL';
else if (changedLines > 499) label = 'size:XL';
else if (changedLines > 99) label = 'size:L';
else if (changedLines > 29) label = 'size:M';
else if (changedLines > 9) label = 'size:S';
else label = 'size:XS';
return label;
- name: Apply size label
uses: actions/github-script@v7
if: steps.calculate-size.outputs.result
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: [ "${{steps.calculate-size.outputs.result}}" ]
})
11 changes: 11 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on:
pull_request:
types: [opened]
name: Pull Request
jobs:
assignAuthor:
name: Assign author to PR
runs-on: ubuntu-latest
steps:
- name: Assign author to PR
uses: technote-space/assign-author@v1

0 comments on commit df9684f

Please sign in to comment.