Skip to content

Commit b613192

Browse files
authored
Merge pull request #42 from gofri/gofri/coffee
Contribution notes
2 parents dc374cf + 0e7a3b2 commit b613192

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Auto Comment on PRs and Issues
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
auto-comment:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Post Comment
18+
uses: actions/github-script@v7
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
script: |
22+
const issue_number = context.payload.issue ? context.payload.issue.number : context.payload.pull_request.number;
23+
const repo = context.repo;
24+
const message = `I am maintaining this repository as a side thing, so my availability varies with time.
25+
26+
No coffee expected, but please leave a star if you find this repository useful :)
27+
28+
Please feel free to ping this issue/PR if I don't respond for a while.`;
29+
30+
github.rest.issues.createComment({
31+
owner: repo.owner,
32+
repo: repo.repo,
33+
issue_number: issue_number,
34+
body: message
35+
});

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,9 @@ I'd be glad to help and add documetation per need.
115115
## License
116116

117117
This package is distributed under the MIT license found in the LICENSE file.
118+
119+
## Contribution
118120
Contribution and feedback is welcome.
121+
I'm trying to drink less coffee so don't buy me one, but please do star this repository if you find it useful.
122+
123+
[![Star History Chart](https://api.star-history.com/svg?repos=gofri/go-github-ratelimit&type=Date)](https://www.star-history.com/#gofri/go-github-ratelimit&Date)

0 commit comments

Comments
 (0)