GitHub Actions / Best practices for writing actions
July 25, 2020 ยท View on GitHub
Stringify objects when using core.* utilities to output logs
Objects are expected to be supported sooner or later.
GOOD
try {
await run();
} catch (err) {
core.setFailed(err.toString());
}
// => ::error::HttpError: Not Found
BAD
try {
await run();
} catch (err) {
core.setFailed(err);
}
// => UnhandledPromiseRejectionWarning: TypeError: (s || "").replace is not a function
Use actions-tagger to automatically update major version tags
GitHub recommends to use semantic versioning and update the major version tag to the latest release. This action automates that: