Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 81df642

Browse files
Merge pull request #2688 from splunk/test-workflow-pr
Adding a new line to test the reminder workflow.
2 parents b904f9a + 82abdd6 commit 81df642

File tree

2 files changed

+10
-58
lines changed

2 files changed

+10
-58
lines changed
Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Pull Request Reminder
1+
name: Heretto Update Reminder
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
5+
types: [opened, synchronize]
66

77
jobs:
88
reminder:
@@ -14,14 +14,13 @@ jobs:
1414
issues: write
1515
checks: write
1616
pull-requests: write
17-
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
2017

21-
- name: Get Pull Request Info
22-
id: pr_info
23-
uses: actions/github-script@v7
18+
19+
steps:
20+
- name: Add PR Comment
21+
uses: actions/github-script@v6
2422
with:
23+
github-token: ${{ secrets.MY_TOKEN }}
2524
script: |
2625
const { owner, repo, number } = context.issue;
2726
const pr = await github.rest.pulls.get({
@@ -31,58 +30,10 @@ jobs:
3130
});
3231
3332
const author = pr.data.user.login;
34-
const createdAt = new Date(pr.data.created_at);
35-
const now = new Date();
36-
const diffInDays = Math.floor((now - createdAt) / (1000 * 60 * 60 * 24));
37-
const labels = pr.data.labels.map(label => label.name);
38-
39-
return { author, diffInDays, number, labels };
40-
41-
- name: Check if Reminder Needed
42-
id: check_reminder
43-
uses: actions/github-script@v7
44-
with:
45-
script: |
46-
const { diffInDays, labels } = ${{ steps.pr_info.outputs }};
47-
const reminderLabel = 'reminder sent';
48-
const daysThreshold = 1; // Number of days before sending reminder. Adjust as needed.
49-
50-
if (!labels) { // Check if labels is undefined or null
51-
return { sendReminder: diffInDays >= daysThreshold }; // send reminder if the time threshold is passed, even without labels.
52-
}
53-
if (labels.includes(reminderLabel)) {
54-
return { sendReminder: false };
55-
}
5633
57-
if (diffInDays >= daysThreshold) {
58-
return { sendReminder: true };
59-
} else {
60-
return { sendReminder: false };
61-
}
62-
63-
- name: Send Reminder Comment
64-
if: ${{ steps.check_reminder.outputs.sendReminder == 'true' }}
65-
uses: actions/github-script@v7
66-
with:
67-
script: |
68-
const { owner, repo, number, author } = ${{ steps.pr_info.outputs }};
69-
const message = `@${author}, please make sure that you update the files in Heretto and post the Heretto share link in this PR.`;
7034
await github.rest.issues.createComment({
7135
owner,
7236
repo,
7337
issue_number: number,
74-
body: message,
75-
});
76-
77-
- name: Add Reminder Label
78-
if: ${{ steps.check_reminder.outputs.sendReminder == 'true' }}
79-
uses: actions/github-script@v7
80-
with:
81-
script: |
82-
const { owner, repo, number } = ${{ steps.pr_info.outputs }};
83-
await github.rest.issues.addLabels({
84-
owner,
85-
repo,
86-
issue_number: number,
87-
labels: ['reminder sent'],
88-
});
38+
body: `@${author}, please make sure that you update the files in Heretto and post the Heretto share link in this PR.`
39+
})

index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,3 +861,4 @@ To keep up to date with changes in the products, see the Splunk Observability Cl
861861
:maxdepth: 3
862862

863863
Contribute to our documentation <get-started/contribute>
864+

0 commit comments

Comments
 (0)