提交 3c390ac7 编写于 作者: sinat_25235033's avatar sinat_25235033

init issue translate action

上级 a255b21b
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
issues:
issue_comment:
branches:
- main
- 'releases/*'
......
name: 'Your name here'
description: 'Provide a description here'
author: 'Your name or organization here'
name: 'issue translator'
description: 'The action for translating non-english issues content to english.'
author: 'tomsun28'
inputs:
milliseconds: # change this
required: true
......
此差异由.gitattributes 抑制。
此差异由.gitattributes 抑制。
此差异已折叠。
......@@ -25,7 +25,10 @@
"author": "",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6"
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@octokit/webhooks": "^7.15.1",
"languagedetect": "^2.0.0"
},
"devDependencies": {
"@types/jest": "^26.0.10",
......
import * as core from '@actions/core'
import {wait} from './wait'
import * as github from '@actions/github'
import * as webhook from '@octokit/webhooks'
async function run(): Promise<void> {
try {
console.log(github.context)
if (github.context.payload.action && !['created', 'opened'].includes(github.context.payload.action)) {
console.log(`The status of the action is no applicable ${github.context.payload.action}, return`)
return
}
if (github.context.eventName == "issue") {
const issuePayload = github.context.payload as webhook.EventPayloads.WebhookPayloadIssues;
console.log(issuePayload)
} else if (github.context.eventName == "issue_comment") {
const issueCommentPayload = github.context.payload as webhook.EventPayloads.WebhookPayloadIssueComment;
console.log(issueCommentPayload)
} else {
console.log(github.context.payload)
}
const ms: string = core.getInput('milliseconds')
core.debug(`Waiting ${ms} milliseconds ...`) // debug is only output if you set the secret `ACTIONS_RUNNER_DEBUG` to true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册