Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lwhiteley/commit-environment
github action to add commit specific environment variables using tags
https://github.com/lwhiteley/commit-environment
actions commit github-actions hacktoberfest
Last synced: 1 day ago
JSON representation
github action to add commit specific environment variables using tags
- Host: GitHub
- URL: https://github.com/lwhiteley/commit-environment
- Owner: lwhiteley
- License: mit
- Created: 2021-01-02T01:49:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T23:00:11.000Z (almost 2 years ago)
- Last Synced: 2024-09-17T01:27:34.822Z (4 months ago)
- Topics: actions, commit, github-actions, hacktoberfest
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/commit-environment
- Size: 1.63 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# commit-environment
Github action to parse ci tags from commit messages. This is a generic tag parser to fit into any workflow that may want to take an action only for a specific commit.
**Possible use case:** Enable demo mode for a specific commit and block build as this must not get into master branch
### tag patterns
```
--ci-skip
--ci-platform=test
--ci-platform-type
--ci-demo-type=blocking
```Tags can have an optional value `=some_value`
Tags will be exported as step outputs and also as environment variables.
To reference as an output or environment variable, please use the snakecase+uppercased version of the tag
for eg.
`--ci-skip` will be transformed into `CI_SKIP`
Practical example:
```
// commit messages
This is my sample commit subjectNow my commit body has some tags
--ci-skip
--ci-platform=test
--ci-platform-type
--ci-demo-type=blocking
--ci-demo-type2=blocking
```Result:
```js
{
CI_SKIP: 'true',
CI_PLATFORM: 'test',
CI_PLATFORM_TYPE: 'true',
CI_DEMO_TYPE: 'blocking'
CI_DEMO_TYPE_2: 'blocking'
}
```