https://github.com/cau777/sha-badge-action
Simple GitHub Actions workflows that compute the short hash for a given branch and generate a badge with it
https://github.com/cau777/sha-badge-action
actions badge utility
Last synced: over 1 year ago
JSON representation
Simple GitHub Actions workflows that compute the short hash for a given branch and generate a badge with it
- Host: GitHub
- URL: https://github.com/cau777/sha-badge-action
- Owner: cau777
- Created: 2023-05-23T12:53:14.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-23T17:01:21.000Z (about 3 years ago)
- Last Synced: 2025-01-29T22:16:16.102Z (over 1 year ago)
- Topics: actions, badge, utility
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SHA Badge Action
This repo contains 2 simple GitHub Actions workflows that compute the short hash for a given branch and generate a badge with it.
This is useful to quickly check what branch is currently deployed. To make it more realistic, the repo has 3 branches
(master, canary and production) with some sample data to make the hashes different.
# Option 1: Storing the hashes



Credit on **schneegans/dynamic-badges-action** for most of the logic.
#### Hosting the hashes
Once computed, the hashes are hosted in [this public gist](https://gist.github.com/cau777/63a20a64c3d5ea1ef487b04c75629f29).
This is necessary because if we tried hosting in the same repo, the badge would not work for private repos (and we
probably don't want to distribute access tokens everywhere).
#### Usage
To include this in your repo:
1) Generate a personal access token with access to gists under profile/developer settings
2) Create an action secret in your repo called `GIST_SECRET` with that token
3) Copy the workflow
# Option 2: Storing SVG



Credit on **emibcn/badge-action** for most of the logic.
For this option, the SVGs are stored in a branch in the same repo. This makes it more
suitable for private repos with security concerns.
### Usage
To include this in your repo:
1) Create an empty orphan branch called `shields-badges`
2) Copy the workflow