upd: added .ip2 network control for workflows.

This commit is contained in:
Ramazan Sancar 2024-05-28 19:53:22 +00:00
parent 2814c5ef47
commit e5e6fa5b12
4 changed files with 6 additions and 15 deletions

View File

@ -5,9 +5,7 @@ on:
types: [opened, reopened] types: [opened, reopened]
jobs: jobs:
replycomment: replycomment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: write-all permissions: write-all
steps: steps:
@ -31,10 +29,10 @@ jobs:
var linkify = require("linkifyjs"); var linkify = require("linkifyjs");
var issueTitleParseUrl = linkify.find(issueInfo.title); var issueTitleParseUrl = linkify.find(issueInfo.title);
if (issueTitleParseUrl.length !== 0) { if (issueTitleParseUrl.length !== 0) {
if (issueInfo.title.includes(".onion")) { if (issueInfo.title.includes(".onion") || issueInfo.title.includes(".ip2")) {
var replyComment = var replyComment =
['Hello! I have detected that you are requesting to add an onion URL.', ['Hello! I have detected that you are requesting to add an onion or I2P URL.',
'Please create a pull request instead for adding your onion url as an alternative to your clearnet URL: https://github.com/iv-org/documentation/edit/master/docs/instances.md' 'Please create a pull request instead for adding your onion or I2P url as an alternative to your clearnet URL: https://github.com/iv-org/documentation/edit/master/docs/instances.md'
].join('\n'); ].join('\n');
await github.rest.issues.createComment({ await github.rest.issues.createComment({
issue_number: context.issue.number, issue_number: context.issue.number,
@ -66,7 +64,6 @@ jobs:
alias: instanceHostname, alias: instanceHostname,
string_match: 'An alternative front-end to YouTube' } }; string_match: 'An alternative front-end to YouTube' } };
request(optionsAddNewCheck, async function (error, response, body) { request(optionsAddNewCheck, async function (error, response, body) {
if (error) throw new Error(error); if (error) throw new Error(error);
if (body.token) { if (body.token) {

View File

@ -5,9 +5,7 @@ on:
types: [opened, reopened] types: [opened, reopened]
jobs: jobs:
replycomment: replycomment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: write-all permissions: write-all
steps: steps:
@ -31,10 +29,10 @@ jobs:
var linkify = require("linkifyjs"); var linkify = require("linkifyjs");
var issueTitleParseUrl = linkify.find(issueInfo.title); var issueTitleParseUrl = linkify.find(issueInfo.title);
if (issueTitleParseUrl.length !== 0) { if (issueTitleParseUrl.length !== 0) {
if (issueInfo.title.includes(".onion")) { if (issueInfo.title.includes(".onion") || issueInfo.title.includes(".ip2")) {
var replyComment = var replyComment =
['Hello! I have detected that you are requesting to add an onion URL.', ['Hello! I have detected that you are requesting to add an onion or I2P URL.',
'Please create a pull request instead for adding your onion url as an alternative to your clearnet URL: https://github.com/iv-org/documentation/edit/master/docs/instances.md' 'Please create a pull request instead for adding your onion or I2P url as an alternative to your clearnet URL: https://github.com/iv-org/documentation/edit/master/docs/instances.md'
].join('\n'); ].join('\n');
await github.rest.issues.createComment({ await github.rest.issues.createComment({
issue_number: context.issue.number, issue_number: context.issue.number,

View File

@ -12,9 +12,7 @@ on:
jobs: jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -5,9 +5,7 @@ on:
types: [closed] types: [closed]
jobs: jobs:
replycomment: replycomment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: write-all permissions: write-all
steps: steps: