Skip to content

Commit dcf7587

Browse files
committed
npm run prepare
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 8975bf5 commit dcf7587

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

dist/index.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ const parseDurationInMilliseconds = (text) => {
2828

2929
const run = async () => {
3030
try {
31-
let issueTitlePrefix = core.getInput('prefix')
32-
issueTitlePrefix = issueTitlePrefix ? issueTitlePrefix + ' ' : ''
31+
// boolean inputs
3332
let dryRun = core.getInput('dry-run')
3433
if (dryRun) dryRun = dryRun === 'true'
3534
let aggregate = core.getInput('aggregate')
3635
if (aggregate) aggregate = aggregate === 'true'
36+
let urlOnly = core.getInput('url-only')
37+
if (urlOnly) urlOnly = urlOnly === 'true'
38+
39+
// integer inputs
3740
let characterLimit = core.getInput('character-limit')
3841
if (characterLimit) characterLimit = parseInt(characterLimit)
42+
43+
// string inputs
44+
let issueTitlePrefix = core.getInput('prefix')
45+
issueTitlePrefix = issueTitlePrefix ? issueTitlePrefix + ' ' : ''
3946
const titlePattern = core.getInput('title-pattern')
4047
const contentPattern = core.getInput('content-pattern')
4148

@@ -49,7 +56,18 @@ const run = async () => {
4956
const octokit = getOctokit(core.getInput('github-token'))
5057

5158
// Instantiate feed parser
52-
const feed = await (new RSSParser({ xml2js: { trim: true } })).parseURL(core.getInput('feed'))
59+
const rssParserOptions = {
60+
headers: {
61+
'User-Agent': 'rss-parser',
62+
Accept: 'application/rss+xml',
63+
// do not keep the connection alive
64+
Connection: 'close'
65+
},
66+
xml2js: {
67+
trim: true
68+
}
69+
}
70+
const feed = await (new RSSParser(rssParserOptions)).parseURL(core.getInput('feed'))
5371
core.info(feed && feed.title)
5472
if (!feed.items || feed.items.length === 0) return
5573

@@ -103,7 +121,7 @@ const run = async () => {
103121
}
104122

105123
// Render issue content
106-
const body = `${markdown || ''}\n${item.link ? `\n${item.link}` : ''}`
124+
const body = urlOnly ? item.link : `${markdown || ''}\n${item.link ? `\n${item.link}` : ''}`
107125

108126
// Default to creating an issue per item
109127
// Create first issue if aggregate

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)