Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port type: needs investigation into linear #44823

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions .github/actions/issue-auto-label/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,24 @@
Object.defineProperty(p, '__esModule', { value: true })
const s = r(a(5438))
const i = r(a(2186))
const o = { LINEAR: 'linear', KIND_BUG: 'kind: bug' }
const o = {
LINEAR: 'linear',
KIND_BUG: 'kind: bug',
NEEDS_INVESTIGAGION: 'type: needs investigation',
}
const n = [o.KIND_BUG, o.NEEDS_INVESTIGAGION]
async function run() {
try {
const { payload: e, repo: p } = s.context
const {
issue: a,
pull_request: d,
label: { name: t },
label: { name: d },
} = e
if (d || !a?.body || !process.env.GITHUB_TOKEN) return
const r = s.getOctokit(process.env.GITHUB_TOKEN).rest
const i = { ...p, issue_number: a.number }
if (t === o.KIND_BUG) {
r.issues.addLabels({ ...i, labels: [o.LINEAR] })
if (!a || !process.env.GITHUB_TOKEN) return
const t = s.getOctokit(process.env.GITHUB_TOKEN).rest
const r = { ...p, issue_number: a.number }
if (n.includes(d)) {
t.issues.addLabels({ ...r, labels: [o.LINEAR] })
}
} catch (e) {
i.setFailed(e.message)
Expand Down Expand Up @@ -6240,8 +6244,8 @@
AbortError.prototype.constructor = AbortError
AbortError.prototype.name = 'AbortError'
const A = r.URL || s.URL
const k = d.PassThrough
const N = function isDomainOrSubdomain(e, p) {
const N = d.PassThrough
const k = function isDomainOrSubdomain(e, p) {
const a = new A(p).hostname
const d = new A(e).hostname
return a === d || (a[a.length - d.length - 1] === '.' && a.endsWith(d))
Expand Down Expand Up @@ -6374,7 +6378,7 @@
timeout: s.timeout,
size: s.size,
}
if (!N(s.url, t)) {
if (!k(s.url, t)) {
for (const e of [
'authorization',
'www-authenticate',
Expand Down Expand Up @@ -6415,7 +6419,7 @@
e.once('end', function () {
if (m) m.removeEventListener('abort', v)
})
let d = e.pipe(new k())
let d = e.pipe(new N())
const t = {
url: s.url,
status: e.statusCode,
Expand Down Expand Up @@ -6445,7 +6449,7 @@
return
}
if (i == 'deflate' || i == 'x-deflate') {
const p = e.pipe(new k())
const p = e.pipe(new N())
p.once('data', function (e) {
if ((e[0] & 15) === 8) {
d = d.pipe(o.createInflate())
Expand Down
8 changes: 5 additions & 3 deletions .github/actions/issue-auto-label/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ import * as core from '@actions/core'
const LABELS = {
LINEAR: 'linear',
KIND_BUG: 'kind: bug',
NEEDS_INVESTIGAGION: 'type: needs investigation',
}

const labelsPortedToLinear = [LABELS.KIND_BUG, LABELS.NEEDS_INVESTIGAGION]

async function run() {
try {
const { payload, repo } = github.context
const {
issue,
pull_request,
label: { name: newLabel },
} = payload

if (pull_request || !issue?.body || !process.env.GITHUB_TOKEN) return
if (!issue || !process.env.GITHUB_TOKEN) return

const client = github.getOctokit(process.env.GITHUB_TOKEN).rest
const issueCommon = { ...repo, issue_number: issue.number }

if (newLabel === LABELS.KIND_BUG) {
if (labelsPortedToLinear.includes(newLabel)) {
client.issues.addLabels({
...issueCommon,
labels: [LABELS.LINEAR],
Expand Down