You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: actions/setup/js/check_workflow_timestamp_api.cjs
+62-26Lines changed: 62 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -130,31 +130,67 @@ async function main() {
130
130
131
131
// Check if workflow file is newer than lock file
132
132
if(workflowTime>lockTime){
133
-
// Clear case: workflow file is newer - needs recompilation
134
-
awaitcompareFrontmatterHashes();// Log for diagnostic purposes
135
-
constwarningMessage=`Lock file '${lockFilePath}' is outdated! The workflow file '${workflowMdPath}' has been modified more recently. Run 'gh aw compile' to regenerate the lock file.`;
// Could not compute hash - be conservative and fail
139
+
core.warning("Could not compare frontmatter hashes - assuming lock file is outdated");
140
+
constwarningMessage=`Lock file '${lockFilePath}' is outdated! The workflow file '${workflowMdPath}' has been modified more recently. Run 'gh aw compile' to regenerate the lock file.`;
.addRaw("**Action Required:** Run `gh aw compile` to regenerate the lock file.\n\n");
158
+
159
+
awaitsummary.write();
160
+
161
+
// Fail the step to prevent workflow from running with outdated configuration
162
+
core.setFailed(warningMessage);
163
+
}elseif(hashComparison.match){
164
+
// Hashes match - lock file is up to date despite timestamp difference
165
+
core.info("✅ Lock file is up to date (frontmatter hashes match despite timestamp difference)");
166
+
}else{
167
+
// Hashes differ - lock file needs recompilation
168
+
constwarningMessage=`Lock file '${lockFilePath}' is outdated! The workflow file '${workflowMdPath}' frontmatter has changed. Run 'gh aw compile' to regenerate the lock file.`;
.addRaw("**Action Required:** Run `gh aw compile` to regenerate the lock file.\n\n");
188
+
189
+
awaitsummary.write();
190
+
191
+
// Fail the step to prevent workflow from running with outdated configuration
192
+
core.setFailed(warningMessage);
193
+
}
158
194
}elseif(workflowCommit.sha===lockCommit.sha){
159
195
// Same commit - definitely up to date
160
196
core.info("✅ Lock file is up to date (same commit)");
@@ -173,7 +209,7 @@ async function main() {
173
209
core.info("✅ Lock file is up to date (hashes match)");
174
210
}else{
175
211
// Hashes differ - lock file needs recompilation
176
-
constwarningMessage=`Lock file '${lockFilePath}' is outdated! Frontmatter hash mismatch detected. Run 'gh aw compile' to regenerate the lock file.`;
212
+
constwarningMessage=`Lock file '${lockFilePath}' is outdated! The workflow file '${workflowMdPath}' frontmatter has changed. Run 'gh aw compile' to regenerate the lock file.`;
0 commit comments