Skip to content

Commit e112efe

Browse files
authored
Added CI automation (#155)
* Added an OWNERS file to control who can review and approve PRs Signed-off-by: Shmuel Kallner <[email protected]> * Added Prow automation Signed-off-by: Shmuel Kallner <[email protected]> * Added automated marking of issues as stale Signed-off-by: Shmuel Kallner <[email protected]> --------- Signed-off-by: Shmuel Kallner <[email protected]>
1 parent 34c29ca commit e112efe

File tree

7 files changed

+162
-0
lines changed

7 files changed

+162
-0
lines changed

.github/workflows/prow-github.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Run specified actions or jobs for issue and PR comments
2+
3+
name: "Prow github actions"
4+
on:
5+
issue_comment:
6+
types: [created]
7+
8+
# Grant additional permissions to the GITHUB_TOKEN
9+
permissions:
10+
# Allow labeling issues
11+
issues: write
12+
# Allow adding a review to a pull request
13+
pull-requests: write
14+
15+
jobs:
16+
prow-execute:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: jpmcb/[email protected]
20+
with:
21+
github-token: "${{ secrets.GITHUB_TOKEN }}"
22+
prow-commands: "/assign
23+
/unassign
24+
/approve
25+
/retitle
26+
/area
27+
/kind
28+
/priority
29+
/remove
30+
/lgtm
31+
/close
32+
/reopen
33+
/lock
34+
/milestone
35+
/hold
36+
/cc
37+
/uncc"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This Github workflow will check every 5m for PRs with the lgtm label and will attempt to automatically merge them.
2+
# If the hold label is present, it will block automatic merging.
3+
4+
name: "Prow merge on lgtm label"
5+
on:
6+
schedule:
7+
- cron: "*/5 * * * *" # every 5 minutes
8+
9+
jobs:
10+
auto-merge:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: jpmcb/[email protected]
14+
with:
15+
jobs: 'lgtm'
16+
github-token: "${{ secrets.GITHUB_TOKEN }}"
17+
merge-method: 'squash'
18+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Jobs on PR
2+
on: pull_request
3+
4+
jobs:
5+
execute:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: jpmcb/[email protected]
9+
with:
10+
jobs: lgtm
11+
github-token: '${{ secrets.GITHUB_TOKEN }}'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Re-Run PR tests
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
rerun_pr_tests:
9+
name: rerun_pr_tests
10+
if: ${{ github.event.issue.pull_request }}
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: estroz/rerun-actions@main
14+
with:
15+
repo_token: ${{ secrets.GITHUB_TOKEN }}
16+
comment_id: ${{ github.event.comment.id }}

.github/workflows/stale.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Mark stale issues'
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * *'
6+
7+
jobs:
8+
stale-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: 'Mark stale issues'
14+
uses: actions/stale@v9
15+
with:
16+
days-before-issue-stale: 90
17+
days-before-pr-stale: -1
18+
days-before-close: -1
19+
stale-issue-label: 'lifecycle/stale'
20+
exempt-issue-labels: 'lifecycle/rotten'
21+
22+
- name: 'Mark rotten issues'
23+
uses: actions/stale@v9
24+
with:
25+
days-before-issue-stale: 30
26+
days-before-pr-stale: -1
27+
days-before-close: -1
28+
stale-issue-label: 'lifecycle/rotten'
29+
only-labels: 'lifecycle/stale'
30+
labels-to-remove-when-stale: 'lifecycle/stale'
31+
32+
- name: 'Close rotten issues'
33+
uses: actions/stale@v9
34+
with:
35+
days-before-stale: -1
36+
days-before-issue-close: 30
37+
days-before-pr-close: -1
38+
stale-issue-label: 'lifecycle/rotten'

.github/workflows/unstale.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Unstale Issue'
2+
3+
on:
4+
issues:
5+
types: [ reopened ]
6+
issue_comment:
7+
types: [ created ]
8+
9+
jobs:
10+
remove-stale:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write
14+
if: >-
15+
github.event.issue.state == 'open' &&
16+
(contains(github.event.issue.labels.*.name, 'lifecycle/stale') ||
17+
contains(github.event.issue.labels.*.name, 'lifecycle/rotten'))
18+
steps:
19+
- name: 'Checkout repository'
20+
uses: actions/checkout@v5
21+
22+
- name: 'Remove stale labels'
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
run: |
26+
echo "Removing 'stale' label from issue #${{ github.event.issue.number }}"
27+
gh issue edit ${{ github.event.issue.number }} --remove-label "lifecycle/stale,lifecycle/rotten"

OWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
approvers:
2+
- mayabar
3+
- irar2
4+
- shmuelk
5+
- elevran
6+
- kfirtoledo
7+
- nilig
8+
9+
reviewers:
10+
- mayabar
11+
- irar2
12+
- shmuelk
13+
- elevran
14+
- kfirtoledo
15+
- nilig

0 commit comments

Comments
 (0)