Skip to content

Commit

Permalink
dependabot-nudge.yml: minLevel high if not first monday, medium other…
Browse files Browse the repository at this point in the history
…wise
  • Loading branch information
thypon committed Jan 8, 2024
1 parent 29aecb7 commit deaffd9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/dependabot-nudge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ jobs:
const debug = process.env.DEBUG === 'true';
const { default: sendSlackMessage } = await import('${{ github.workspace }}/src/sendSlackMessage.js');
const { default: dependabotNudge } = await import('${{ github.workspace }}/src/dependabotNudge.js');
const messages = await dependabotNudge({debug, org: process.env.GITHUB_REPOSITORY_OWNER, github: github, minlevel: 'medium'});
// set minlevel to 'medium' if it's the first Monday of the month, otherwise stick to high or critical issues
let minlevel = 'medium';
const today = new Date();
const firstMonday = new Date(today.getFullYear(), today.getMonth(), 1 + (1 - today.getDay()) % 7);
if (today.getMonth() !== firstMonday.getMonth() || today.getDate() !== firstMonday.getDate()) {
if (debug)
console.log('Not the first Monday of the month!');
minlevel = 'high';
}
const messages = await dependabotNudge({debug, org: process.env.GITHUB_REPOSITORY_OWNER, github: github, minlevel: minlevel});
for (const message of messages) {
try {
Expand Down

0 comments on commit deaffd9

Please sign in to comment.