Skip to content

Commit 544da60

Browse files
committed
Added automation workflows
added auto-assigner, auto-commenter, auto-labeler and stale automation workflows.
1 parent 8912a99 commit 544da60

File tree

5 files changed

+148
-0
lines changed

5 files changed

+148
-0
lines changed

.github/auto-assign-config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Set to true to add reviewers to pull requests
2+
addReviewers: true
3+
4+
# Set to true to add assignees to pull requests
5+
addAssignees: author
6+
7+
# A list of reviewers to be added to pull requests (GitHub user name)
8+
reviewers:
9+
- iamwatchdogs
10+
11+
# A number of reviewers added to the pull request
12+
# Set 0 to add all the reviewers (default: 0)
13+
numberOfReviewers: 1
14+
15+
# A list of assignees, overrides reviewers if set
16+
# assignees:
17+
# - assigneeA
18+
19+
# A number of assignees to add to the pull request
20+
# Set to 0 to add all of the assignees.
21+
# Uses numberOfReviewers if unset.
22+
# numberOfAssignees: 2
23+
24+
# A list of keywords to be skipped the process that add reviewers if pull requests include it
25+
# skipKeywords:
26+
# - wip
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Auto Assign
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, ready_for_review]
6+
issues:
7+
types: [opened]
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
auto-assign:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: kentaro-m/[email protected]
18+
with:
19+
configuration-path: '.github/auto-assign-config.yml'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Auto-commenter
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, closed]
6+
7+
permissions:
8+
id-token: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
automated-message:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: wow-actions/auto-comment@v1
17+
with:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
pullRequestOpened: |
20+
👋 @{{ author }}
21+
Thank you for raising your pull request.
22+
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
23+
24+
pullRequestClosed: |
25+
👋 @{{ author }} This PR is closed. If you think there's been a mistake, please contact the maintainer @iamwatchdogs.
26+
27+
pullRequestMerged: |
28+
Thank you for contributing @{{ author }}. Make sure to check your contribution on [GitHub Pages](https://grow-with-open-source.github.io/C-CPP-Projects/ "view contributions").

.github/workflows/auto-labeler.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: hacktoberfest-labeler
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, closed]
6+
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
auto-labeler:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check for hacktoberfest season
17+
id: check-month
18+
run: |
19+
current_month=$(date +'%m')
20+
if [ "$current_month" == "10" ]; then
21+
echo "is_october=true" >> $GITHUB_OUTPUT
22+
else
23+
echo "is_october=false" >> $GITHUB_OUTPUT
24+
fi
25+
26+
- name: Creating config file
27+
env:
28+
ACTION: ${{ github.event.action }}
29+
run: |
30+
touch ./hacktoberfest-labeler.yml
31+
32+
if [ "$ACTION" != "closed" ]; then
33+
echo "hacktoberfest:" > hacktoberfest-labeler.yml
34+
else
35+
echo "hacktoberfest-accepted:" > hacktoberfest-labeler.yml
36+
fi
37+
echo "- changed-files:" >> hacktoberfest-labeler.yml
38+
echo " - any-glob-to-any-file: '**'" >> hacktoberfest-labeler.yml
39+
40+
echo "Created the config file:"
41+
echo "------------------------"
42+
cat ./hacktoberfest-labeler.yml
43+
44+
- name: Label the PRs
45+
if: steps.check-month.outputs.is_october == 'true' ||
46+
github.event.pull_request.merged == 'true' &&
47+
contains(github.event.pull_request.labels.*.name, 'hacktoberfest')
48+
uses: actions/[email protected]
49+
with:
50+
configuration-path: ./hacktoberfest-labeler.yml

.github/workflows/stale.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: close-stale-issue-and-prs
2+
3+
on:
4+
schedule:
5+
- cron: '30 1 * * *'
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@v8
17+
with:
18+
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
19+
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
20+
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
21+
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
22+
days-before-issue-stale: 30
23+
days-before-pr-stale: 45
24+
days-before-issue-close: 5
25+
days-before-pr-close: 10

0 commit comments

Comments
 (0)