Skip to content

Commit 882174d

Browse files
committed
Add explicit sort order to workflow runs query
Explicitly sort workflow runs by created date in descending order to ensure early exit optimization works correctly. This makes the assumption that newer runs appear first more explicit and reliable. - Add sort: 'created' parameter - Add direction: 'desc' parameter This ensures the early exit logic (stopping when we see SHAs different from the previous commit) works as intended.
1 parent 4917fa1 commit 882174d

File tree

1 file changed

+3
-1
lines changed
  • .github/actions/ensure-master-docs-safety

1 file changed

+3
-1
lines changed

.github/actions/ensure-master-docs-safety/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ runs:
3939
branch: 'master',
4040
event: 'push',
4141
per_page: 30,
42-
created: `>${createdAfter}`
42+
created: `>${createdAfter}`,
43+
sort: 'created',
44+
direction: 'desc'
4345
}
4446
)) {
4547
const pageRuns = response.data;

0 commit comments

Comments
 (0)