Skip to content

Commit bcbff71

Browse files
ReenigneArcherdscho
authored andcommitted
feat: add url only input option
1 parent 97e45f2 commit bcbff71

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ Only create an issue if the content matches the specified [regular expression](h
5656

5757
To _exclude_ items based on their content, you can use a negative lookahead. For example, to filter out all feed items whose text contains "TEST", use a regular expression like `/^(?!.*TEST)/`.
5858

59+
### `url-only`
60+
61+
If set, only the URL is added to the issue body
62+
5963
## Outputs
6064

6165
### `issues`
@@ -96,6 +100,7 @@ jobs:
96100
dry-run: false
97101
max-age: 48h
98102
labels: git
103+
url-only: false
99104
```
100105
101106
### Real Usage

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ inputs:
2828
description: "Limit to feed items whose titles match this regular expression"
2929
content-pattern:
3030
description: "Limit to feed items whose contents match this regular expression"
31+
url-only:
32+
description: "If set, only the URL is added to the issue body"
33+
default: 'false'
34+
required: false
3135
outputs:
3236
issues:
3337
description: "issue IDs, comma separated"

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const run = async () => {
2727
if (dryRun) dryRun = dryRun === 'true'
2828
let aggregate = core.getInput('aggregate')
2929
if (aggregate) aggregate = aggregate === 'true'
30+
let urlOnly = core.getInput('url-only')
31+
if (urlOnly) urlOnly = urlOnly === 'true'
3032

3133
// integer inputs
3234
let characterLimit = core.getInput('character-limit')
@@ -102,7 +104,7 @@ const run = async () => {
102104
}
103105

104106
// Render issue content
105-
const body = `${markdown || ''}\n${item.link ? `\n${item.link}` : ''}`
107+
const body = urlOnly ? item.link : `${markdown || ''}\n${item.link ? `\n${item.link}` : ''}`
106108

107109
// Default to creating an issue per item
108110
// Create first issue if aggregate

0 commit comments

Comments
 (0)