我在Ruby中有以下代码.我想将此代码转换为JavaScript.什么是JS中的等效代码?
text = <<"HERE"
This
Is
A
Multiline
String
HERE
Run Code Online (Sandbox Code Playgroud) 我正在尝试从 GitHub 操作的拉取请求中插入常规评论。我似乎无法正确理解。Octokit 是底层库,允许您为PR创建reviewComments,但那些指的是提交,这不是我想要的,我想要一个简单的评论。我想我可以只使用octokit.issues.createComment
. 但是,这似乎不起作用。这是代码
import * as core from '@actions/core';
const {GitHub, context} = require('@actions/github')
const parse = require('parse-diff')
async function run() {
try {
// get information on everything
const token = core.getInput('github-token', {required: true})
const github = new GitHub(token, {} )
console.log( context )
const PR_number = context.payload.pull_request.number
// Check if the body contains required string
const bodyContains = core.getInput('bodyContains')
if ( context.payload.pull_request.body.indexOf( bodyContains) < 0 ) {
core.setFailed("The body of the …
Run Code Online (Sandbox Code Playgroud)