Write the current commit ID to a file. Intended mainly for workflows triggered by push or that otherwise have a meaningful github.sha.
It's up to the caller to make and check in the file with the pattern to replace in it; it is recommended that the pattern string only appear once. It's assumed that updated file will not be committed back to the repository; this is intended as an immediate pre-build step.
- uses: UoMResearchIT/actions/commit-id@v1.2.6
with:
file: src/build_id.hWhich might be paired with a source file (in src/build_id.h for example) like this for C or C++:
/* Do not edit the next line manually. */
#define COMMIT_ID "undefined (dev build)" - uses: UoMResearchIT/actions/commit-id@v1.2.6
with:
file: src/version.pytogether with the file src/version.py:
build_version: str = """undefined (dev build)"""-
fileThe name of the existing file to process. Required.
Example:
src/build_id.h -
patternThe literal substring to replace. Optional.
Defaults toundefined (dev build)
None.