Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 .