@@ -28,14 +28,21 @@ const parseDurationInMilliseconds = (text) => {
28
28
29
29
const run = async () => {
30
30
try {
31
- let issueTitlePrefix = core.getInput('prefix')
32
- issueTitlePrefix = issueTitlePrefix ? issueTitlePrefix + ' ' : ''
31
+ // boolean inputs
33
32
let dryRun = core.getInput('dry-run')
34
33
if (dryRun) dryRun = dryRun === 'true'
35
34
let aggregate = core.getInput('aggregate')
36
35
if (aggregate) aggregate = aggregate === 'true'
36
+ let urlOnly = core.getInput('url-only')
37
+ if (urlOnly) urlOnly = urlOnly === 'true'
38
+
39
+ // integer inputs
37
40
let characterLimit = core.getInput('character-limit')
38
41
if (characterLimit) characterLimit = parseInt(characterLimit)
42
+
43
+ // string inputs
44
+ let issueTitlePrefix = core.getInput('prefix')
45
+ issueTitlePrefix = issueTitlePrefix ? issueTitlePrefix + ' ' : ''
39
46
const titlePattern = core.getInput('title-pattern')
40
47
const contentPattern = core.getInput('content-pattern')
41
48
@@ -49,7 +56,18 @@ const run = async () => {
49
56
const octokit = getOctokit(core.getInput('github-token'))
50
57
51
58
// 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'))
53
71
core.info(feed && feed.title)
54
72
if (!feed.items || feed.items.length === 0) return
55
73
@@ -103,7 +121,7 @@ const run = async () => {
103
121
}
104
122
105
123
// 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}` : ''}`
107
125
108
126
// Default to creating an issue per item
109
127
// Create first issue if aggregate
0 commit comments