Skip to content

Commit 0d3b9b6

Browse files
committed
[antispam] experimenting (WIP)
1 parent 1be3062 commit 0d3b9b6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/antispam.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
with:
1919
script: |
2020
const script = require('.github/workflows/scripts/antispam.js')
21-
await script({octokit, context, core})
21+
await script({github, context, core})

.github/workflows/scripts/antispam.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@ async function when_suspicious(){
22

33
// might wanna use a score of confidence (how suspicious it is), then react on that
44

5-
await octokit.rest.issues.addLabels({
5+
await github.rest.issues.addLabels({
66
owner,
77
repo,
88
issue_number: issueNumber,
99
labels: ["suspicious"]
1010
});
1111

12-
// await octokit.rest.issues.update({
12+
// await github.rest.issues.update({
1313
// owner,
1414
// repo,
1515
// issue_number: issueNumber,
1616
// state: "closed"
1717
// });
18-
// await octokit.rest.issues.createComment({
18+
// await github.rest.issues.createComment({
1919
// owner,
2020
// repo,
2121
// issue_number: issueNumber,
2222
// body: "This issue/PR has been automatically closed as it does not meet our contribution guidelines. Please read our contribution guide before submitting."
2323
// });
2424
}
2525

26-
module.exports = async ({ octokit, context, core }) => {
26+
module.exports = async ({ github, context, core }) => {
2727
const {SHA} = process.env;
2828
const author = context.actor;
2929

30-
const { data: user } = await octokit.rest.users.getByUsername({ username: author });
30+
const { data: user } = await github.rest.users.getByUsername({ username: author });
3131

3232
console.log(">>> module: ", {
3333
user: user,

0 commit comments

Comments
 (0)