This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test results | |
# If a "workflow run" that is in the pending state is cancelled, then no jobs in that "workflow run" will execute - doesn't matter what their if condition is. | |
# If a "workflow run" that is in the running state is cancelled, then: | |
# 1. All jobs that are in the Running state will be stopped and anything that's actively being executed will be killed wherever they are in their execution. This can leave external services in an inconsistent state unless you actively handle it. | |
# 2. Any jobs that are conditional on the `cancelled()` status function will have their condition checked and if true will then execute. | |
# The remaining "workflow run" states are unaffected by cancellation as the run is already terminated: Cancelled, Failure, and Success. | |
# Jobs can terminate with the following states: | |
# * cancelled - meaning that at some point in the job somthing cancelled the workflow run, whether human or machine. E.g. if the workflow run was aborted via the concurrency cancel-in-progress flag being true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Recursively converts the given value to a similar structure but with the values replaced by their types. | |
* | |
* Useful for debugging datastructures you can't dig into via a debugger and that you don't already know the types of. | |
*/ | |
function objToTypeReadout(key: string, value: any): { [key: string]: any } { | |
if (Array.isArray(value)) { | |
return { | |
[key]: typeof value, | |
value: value.map((v, i) => objToTypeReadout(i.toFixed(0), v)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Nice formatting of TXT files | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Format online text files in a clean and easy to read way without losing fixed width needs. | |
// @author Ricky Curtice | |
// @match *://*/*.txt | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function iswitch(key, map, def) { | |
return map !== null && typeof map === 'object' && map.hasOwnProperty(key) ? map[key] : def; // This way falsy values can be returned. | |
} | |
let result = iswitch('a', { | |
'a': "first value", | |
'b': "second value", | |
}, "default value"); |