Skip to content

Commit

Permalink
Update issue-editor.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kmsu44 authored Jan 18, 2025
1 parent ccc9661 commit 7fa0793
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/issue-editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,6 @@ on:
types: [opened, edited]

jobs:
create-issue:
runs-on: ubuntu-latest
if: github.event_name == 'repository_dispatch'
steps:
- name: Create GitHub Issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
uses: actions/github-script@v6
with:
script: |
// Jira to GitHub ๋งˆํฌ๋‹ค์šด ๋ณ€ํ™˜ ํ•จ์ˆ˜
function convertJiraToGitHub(text) {
if (!text) return text;
// ํ—ค๋”ฉ ๋ณ€ํ™˜
text = text.replace(/h([1-6])\.\s/g, (_, level) => '#'.repeat(level) + ' ');
// ์ฝ”๋“œ ๋ธ”๋ก ๋ณ€ํ™˜
text = text.replace(/{code(:([a-z]+))?}([\s\S]*?){code}/g, (_, __, lang, code) =>
'```' + (lang || '') + '\n' + code + '```'
);
// ํŒจ๋„ ๋ณ€ํ™˜
text = text.replace(/{panel}([\s\S]*?){panel}/g, '> $1');
// ์ธ์šฉ๊ตฌ ๋ณ€ํ™˜
text = text.replace(/bq\.\s/g, '> ');
// ๊ธ€๋จธ๋ฆฌ ๊ธฐํ˜ธ ๋ณ€ํ™˜
text = text.replace(/^\*\s/gm, '- ');
// ๋งํฌ ๋ณ€ํ™˜
text = text.replace(/\[([^\|]+)\|([^\]]+)\]/g, '[$1]($2)');
// ๋ฐ‘์ค„ ๋ณ€ํ™˜
text = text.replace(/\+([^+]+)\+/g, '__$1__');
// ์ƒ‰์ƒ ํ…์ŠคํŠธ ๋ณ€ํ™˜
text = text.replace(/{color:[^}]+}([^{]+){color}/g, '`$1`');
// ํ‘œ ๋ณ€ํ™˜
text = text.replace(/\|\|([^\n]+)\|\|/g, '|$1|');
return text;
}
const { issue } = context.payload;
// JIRA ์„ค๋ช…์„ GitHub ๋งˆํฌ๋‹ค์šด์œผ๋กœ ๋ณ€ํ™˜
const convertedDescription = convertJiraToGitHub(issue.fields.description || 'No description');
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `[${issue.key}] ${issue.fields.summary}`,
body: `
Jira Issue: ${issue.key}
${convertedDescription}
---
Priority: ${issue.fields.priority?.name || 'Not set'}
Status: ${issue.fields.status.name}
[View in Jira](${process.env.JIRA_URL}/browse/${issue.key})
`
});
convert-markdown:
runs-on: ubuntu-latest
if: github.event_name == 'issues'
Expand Down

0 comments on commit 7fa0793

Please sign in to comment.