Skip to content

Commit

Permalink
disable comment and issue creation from actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cirosantilli committed Aug 3, 2022
1 parent 523ccac commit 316a07b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ Not mentioned in other sections:
** on <<gov-takedowns-china>>: https://github.com/github/gov-takedowns/blob/master/China/2021/2021-01-29-BNIA.md
* https://github.com/ycjyy/ycjyy[]. Several news reposts on comments, e.g. https://github.com/ycjyy/ycjyy/issues/302[]. Particularly likes the site https://www.aboluowang.com/index.html 阿波罗综合新闻网 "Appolo Comprehensive News Website"
* https://github.com/u2017/u2017/wiki has an anti-CCP wiki. Likely <<falun-gong>> believer given the imagery on the index page.
* https://github.com/TaiduGousima/Fuck-cirosantilli

Interesting users:

Expand Down
41 changes: 22 additions & 19 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,24 @@ if (!isComment) {
// Make the request.
try {
const octokit = new github.getOctokit(process.env.GITHUB_TOKEN);
const new_comment = octokit.issues.createComment({
owner: payload.repository.owner.login,
repo: payload.repository.name,
issue_number: payload.issue.number,
body: replyBody,
});
// https://github.com/cirosantilli/china-dictatorship/issues/1330
//const new_comment = octokit.issues.createComment({
// owner: payload.repository.owner.login,
// repo: payload.repository.name,
// issue_number: payload.issue.number,
// body: replyBody,
//});
let html_url
if (isComment) {
const title = (`@${author}: ` + noQuoteArray.join('\n').replaceAll('\n', ' ')).substring(0, 255)
html_url = payload.comment.html_url
const new_issue = octokit.issues.create({
owner: payload.repository.owner.login,
repo: payload.repository.name,
title,
body: html_url + '\n\n' + replyBody,
})
// https://github.com/cirosantilli/china-dictatorship/issues/1330
//const new_issue = octokit.issues.create({
// owner: payload.repository.owner.login,
// repo: payload.repository.name,
// title,
// body: html_url + '\n\n' + replyBody,
//})
} else {
// Update labels.
await octokit.issues.update({
Expand Down Expand Up @@ -224,13 +226,14 @@ try {
const title = match[1]
const link = match[2]
const body = lines[4]
const new_issue_duty = await octokit.issues.create({
owner: payload.repository.owner.login,
repo: payload.repository.name,
title: title + ' ' + link,
body: content.data.html_url + '\n\n' + link + '\n\n' + html_url + '\n\n' + body,
labels: ['duty-machine'],
})
// https://github.com/cirosantilli/china-dictatorship/issues/1330
//const new_issue_duty = await octokit.issues.create({
// owner: payload.repository.owner.login,
// repo: payload.repository.name,
// title: title + ' ' + link,
// body: content.data.html_url + '\n\n' + link + '\n\n' + html_url + '\n\n' + body,
// labels: ['duty-machine'],
//})
}
} catch (error) {
core.setFailed(error.message);
Expand Down

0 comments on commit 316a07b

Please sign in to comment.