Skip to content

Commit eef8680

Browse files
authored
CLOUD-727 automate labeling and PR management (#1844)
* CLOUD-727 close stale PRs * * add community for community PRs * add possibility of adding different labels for PRs * fix labeler.yml * add CONTRIBUTING.md into doc label * add doc lavel for code-of-conduct.md file * add chenges into Jenkinsfile for tests * remove Jenkinsfile * more tests * remove changes from Jenkinsfile * update labeles
1 parent 22663a4 commit eef8680

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

.github/labeler.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
doc:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- 'README*'
5+
- 'CONTRIBUTING*'
6+
- 'code-of-conduct*'
7+
8+
tests:
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- 'e2e-tests/**'
12+
- 'Jenkinsfile*'
13+
14+
ci:
15+
- changed-files:
16+
- any-glob-to-any-file: '.github/workflows/**'
17+
18+
build:
19+
- changed-files:
20+
- any-glob-to-any-file: 'build/**'
21+
22+
olm:
23+
- changed-files:
24+
- any-glob-to-any-file: 'installers/olm/**'
25+
26+
dependencies:
27+
- changed-files:
28+
- any-glob-to-any-file:
29+
- 'go.mod'
30+
- 'go.sum'

.github/workflows/labeler.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "PR Labeler"
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
6+
jobs:
7+
label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: "Label PR"
14+
uses: actions/labeler@v5
15+
with:
16+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
17+
sync-labels: true
18+
19+
label-community:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: "Check if PR is from a fork"
23+
if: github.event.pull_request.head.repo.fork == true
24+
run: |
25+
gh pr edit ${{ github.event.pull_request.number }} --add-label "community"
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+

.github/workflows/stale.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Close Stale PRs"
2+
on:
3+
schedule:
4+
- cron: "0 3 * * *" # Runs daily at 03:00 UTC
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v9
11+
with:
12+
any-of-labels: 'community'
13+
exempt-all-pr-milestones: true
14+
days-before-stale: 30 # Mark as stale after 30 days
15+
days-before-close: 14 # Close after 14 more days
16+
stale-pr-label: "stale"
17+
exempt-pr-labels: "work-in-progress,blocked"
18+
operations-per-run: 30
19+
remove-stale-when-updated: true
20+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
21+

0 commit comments

Comments
 (0)