Skip to content

Commit

Permalink
Merge pull request #95 from Plabick/main
Browse files Browse the repository at this point in the history
Finish implementation of ancient PR message
  • Loading branch information
kellertk authored Sep 21, 2021
2 parents 5abec9d + de23c4f commit 57e400a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ steps:

# Messages this action will apply to issues
stale-issue-message: Stale issue message
stale-pr-message: Stale issue message
ancient-issue-message: Stale issue message
stale-pr-message: Stale pr message
ancient-issue-message: Ancient issue message
ancient-pr-message: Ancient pr message


# Labels this action will apply to issues
stale-issue-label: closing-soon
Expand Down
1 change: 1 addition & 0 deletions sample_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
# Setting messages to an empty string will cause the automation to skip
# that category
ancient-issue-message: Ancient issue message
ancient-pr-message: Ancient pr message
stale-issue-message: Stale issue message
stale-pr-message: Stale issue message

Expand Down
3 changes: 2 additions & 1 deletion src/entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function getAndValidateInputs() {
const args = {
repoToken: process.env.REPO_TOKEN,
ancientIssueMessage: process.env.ANCIENT_ISSUE_MESSAGE,
ancientPrMessage: process.env.ANCIENT_PR_MESSAGE,
staleIssueMessage: process.env.STALE_ISSUE_MESSAGE,
stalePrMessage: process.env.STALE_PR_MESSAGE,
daysBeforeStale: parseFloat(process.env.DAYS_BEFORE_STALE),
Expand Down Expand Up @@ -94,7 +95,7 @@ async function processIssues(client, args) {
? args.ancientPrMessage
: args.ancientIssueMessage;
*/
const ancientMessage = args.ancientIssueMessage;
const ancientMessage = isPr ? args.ancientPrMessage : args.ancientIssueMessage;

const staleLabel = isPr ? args.stalePrLabel : args.staleIssueLabel;
const exemptLabels = parseCommaSeparatedString(
Expand Down
1 change: 1 addition & 0 deletions test/.env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ NODE_ENV=development

REPO_TOKEN=FAKE-REPO-TOKEN
ANCIENT_ISSUE_MESSAGE='Ancient issue message.'
ANCIENT_PR_MESSAGE='Ancient Pr message.'
STALE_ISSUE_MESSAGE='Stale issue message.'
STALE_PR_MESSAGE='Stale pr message.'
DAYS_BEFORE_STALE=0.05
Expand Down
1 change: 1 addition & 0 deletions test/local-docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
REPO_TOKEN=

ANCIENT_ISSUE_MESSAGE=Ancient issue message
ANCIENT_PR_MESSAGE=Ancient Pr message
STALE_ISSUE_MESSAGE=Stale issue message
STALE_PR_MESSAGE=Stale pr message
DAYS_BEFORE_STALE=7
Expand Down

0 comments on commit 57e400a

Please sign in to comment.