Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devourtech/snapshotter
GitHub action to create custom git tags
https://github.com/devourtech/snapshotter
ci-cd docker github-actions publishing shell-script
Last synced: 2 months ago
JSON representation
GitHub action to create custom git tags
- Host: GitHub
- URL: https://github.com/devourtech/snapshotter
- Owner: DevourTech
- License: mit
- Created: 2021-07-09T15:06:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-10T19:24:48.000Z (over 3 years ago)
- Last Synced: 2024-10-15T11:39:30.113Z (2 months ago)
- Topics: ci-cd, docker, github-actions, publishing, shell-script
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snapshotter
A `GitHub` Action which creates a string
using the `commit SHA` and the `current timestamp` which can be used to name a `tag` and then publish it to `GitHub`.## Usage
```yml
name: snapshot workflow
on:
push:
branches:
- master
jobs:
Generate Tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create tag with Github SHA and timestamp
uses: DevourTech/[email protected]
with:
BASE_VERSION: v0.0.0
GITHUB_TOKEN: ${{ github.token }}
GITHUB_USERNAME:
GITHUB_REPOSITORY:
```## Options
### Inputs
- `BASE_VERSION` (Required)
Base semantic version used to create snapshot.
**Eg. v3.4.3**- `GITHUB_TOKEN` (Required)
Github Token used to authenticate to GitHub.
- `GITHUB_USERNAME` (Required)
Username used to login to GitHub
**Eg. DevourTech**- `GITHUB_REPOSITORY` (Required)
Repository for which the tag is supposed to be generated on the latest commit.
**Eg. snapshotter**### Outputs
- `SNAPSHOT_VERSION`Version generated by the action.
**Eg.v3.4.3-20200712152333-a007e621125e**
## Workflow
- Add this action to your repo
- Commit some changes
- push either to **master** or any other branch specified in the workflow
- On **push (or merge)**, the action will:
- Get the latest commit hash and timestamp
- Generate a custom string using the above two arguments### NOTE
This action just generates a custom string which can be used as an output to release a tag with custom name.
If you also want to release this tag to `GitHub`, add this action [GitHub Script](https://github.com/marketplace/actions/github-script)
to your workflow file .