@@ -35143,6 +35143,17 @@ const parseField = (rawField, field) => {
3514335143 return values
3514435144}
3514535145
35146+ // True when `values` already covers every value in the field's domain, in
35147+ // which case the field places no real restriction on the schedule.
35148+ const coversFullDomain = (values, field) => {
35149+ for (let value = field.min; value <= field.max; value += 1) {
35150+ if (!values.has(value)) {
35151+ return false
35152+ }
35153+ }
35154+ return true
35155+ }
35156+
3514635157const parseCron = expression => {
3514735158 const fields = expression.trim().split(/\s+/)
3514835159 if (fields.length !== CRON_FIELDS.length) {
@@ -35153,17 +35164,31 @@ const parseCron = expression => {
3515335164
3515435165 const schedule = {}
3515535166 CRON_FIELDS.forEach((field, index) => {
35156- const rawField = fields[index]
3515735167 schedule[field.name] = {
35158- restricted: rawField !== '*',
35159- values: parseField(rawField, field),
35168+ values: parseField(fields[index], field),
3516035169 }
3516135170 })
3516235171
35163- // In cron, both 0 and 7 represent Sunday.
35172+ // In cron, both 0 and 7 represent Sunday, so keep the set consistent in both
35173+ // directions (this also lets `0-6` count as covering every weekday).
3516435174 if (schedule.dayOfWeek.values.has(7)) {
3516535175 schedule.dayOfWeek.values.add(0)
3516635176 }
35177+ if (schedule.dayOfWeek.values.has(0)) {
35178+ schedule.dayOfWeek.values.add(7)
35179+ }
35180+
35181+ // A field only constrains the schedule when it does not match its entire
35182+ // domain. Treating expressions such as `*/1` or `0-6` (day-of-week) as
35183+ // restricted would wrongly trigger the day-of-month/day-of-week OR rule in
35184+ // isWithinMergeWindow(), so derive `restricted` from the expanded values
35185+ // rather than the raw text.
35186+ CRON_FIELDS.forEach(field => {
35187+ schedule[field.name].restricted = !coversFullDomain(
35188+ schedule[field.name].values,
35189+ field
35190+ )
35191+ })
3516735192
3516835193 return schedule
3516935194}
@@ -35390,7 +35415,7 @@ module.exports = {
3539035415/***/ ((module) => {
3539135416
3539235417"use strict";
35393- module.exports = /*#__PURE__*/JSON.parse('{"name":"github-action-merge-dependabot","version":"3.12 .0","description":"A GitHub action to automatically merge and approve Dependabot pull requests","main":"src/index.js","type":"commonjs","scripts":{"build":"ncc build src/index.js","lint":"eslint .","lint:fix":"eslint . --fix","test":"c8 --100 node --test"},"author":{"name":"Salman Mitha","email":"SalmanMitha@gmail.com"},"contributors":["Simone Busoli <simone.busoli@nearform.com>"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/github-action-merge-dependabot.git"},"bugs":{"url":"https://github.com/fastify/github-action-merge-dependabot/issues"},"homepage":"https://github.com/fastify/github-action-merge-dependabot#readme","dependencies":{"@actions/core":"^1.11.1","actions-toolkit":"github:nearform/actions-toolkit"},"devDependencies":{"@vercel/ncc":"^0.38.4","c8":"^11.0.0","eslint":"^9.39.2","neostandard":"^0.13.0","proxyquire":"^2.1.3","sinon":"^21.1.2"}}');
35418+ module.exports = /*#__PURE__*/JSON.parse('{"name":"github-action-merge-dependabot","version":"3.13 .0","description":"A GitHub action to automatically merge and approve Dependabot pull requests","main":"src/index.js","type":"commonjs","scripts":{"build":"ncc build src/index.js","lint":"eslint .","lint:fix":"eslint . --fix","test":"c8 --100 node --test"},"author":{"name":"Salman Mitha","email":"SalmanMitha@gmail.com"},"contributors":["Simone Busoli <simone.busoli@nearform.com>"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/github-action-merge-dependabot.git"},"bugs":{"url":"https://github.com/fastify/github-action-merge-dependabot/issues"},"homepage":"https://github.com/fastify/github-action-merge-dependabot#readme","dependencies":{"@actions/core":"^1.11.1","actions-toolkit":"github:nearform/actions-toolkit"},"devDependencies":{"@vercel/ncc":"^0.38.4","c8":"^11.0.0","eslint":"^9.39.2","neostandard":"^0.13.0","proxyquire":"^2.1.3","sinon":"^21.1.2"}}');
3539435419
3539535420/***/ })
3539635421
0 commit comments