Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anandchowdhary/package-version-action
🔖 GitHub Action to get the release version and a SHA suffix
https://github.com/anandchowdhary/package-version-action
github-actions javascript package-json pkg typescript version
Last synced: 3 months ago
JSON representation
🔖 GitHub Action to get the release version and a SHA suffix
- Host: GitHub
- URL: https://github.com/anandchowdhary/package-version-action
- Owner: AnandChowdhary
- License: mit
- Archived: true
- Created: 2021-01-03T16:50:26.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-07T09:15:53.000Z (over 3 years ago)
- Last Synced: 2024-09-29T23:41:52.837Z (3 months ago)
- Topics: github-actions, javascript, package-json, pkg, typescript, version
- Language: TypeScript
- Homepage:
- Size: 3.33 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔖 Package Version Action
GitHub Action to get the latest release version and a SHA suffix for unique versions.
[![Build CI](https://github.com/koj-co/package-version-action/workflows/Build%20CI/badge.svg)](https://github.com/koj-co/package-version-action/actions?query=workflow%3A%22Build+CI%22)
[![Test CI](https://github.com/koj-co/package-version-action/workflows/Test%20CI/badge.svg)](https://github.com/koj-co/package-version-action/actions?query=workflow%3A%22Test+CI%22)
[![Release CI](https://github.com/koj-co/package-version-action/workflows/Release%20CI/badge.svg)](https://github.com/koj-co/package-version-action/actions?query=workflow%3A%22Release+CI%22)
[![Node CI](https://github.com/koj-co/package-version-action/workflows/Node%20CI/badge.svg)](https://github.com/koj-co/package-version-action/actions?query=workflow%3A%22Node+CI%22)## ⭐ Get started
This Action returns a recommend image name. For example, if you want to publish a new Docker image:
```yaml
name: Docker CI
on:
workflow_dispatch:
jobs:
test:
name: Deploy to Docker
runs-on: ubuntu-latest
steps:
- name: Get package version
id: package-version
uses: koj-co/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to Docker
uses: docker/build-push-action@v2
with:
push: true
tags: username/anand:${{ steps.package-version.outputs.package-version }}
# -> username/anand:v1.23.21
```### Outputs
| Output name | Description | Example value |
| ---------------------------- | -------------------------- | ----------------------------------- |
| `package-version` | Latest release version | v2.23.1 |
| `package-version-timestamp` | Version + unix timestamp | v2.23.1-1609693587 |
| `short-hash` | Last commit hash | 1abc9c3 |
| `package-version-short-hash` | Version + commit hash | v2.23.1-1abc9c3 |
| `package-version-random` | Version + random string | v2.23.1-238a32ef21 |
| `date-hash` | Date + commit hash | 2020-12-29-238a32ef21 |
| `date-time-hash` | ISO datetime + commit hash | 2020-12-29T09:35:34.759Z-238a32ef21 |## 📄 License
- Code: [MIT](./LICENSE) © [Koj](https://koj.co)
- "GitHub" is a trademark of GitHub, Inc.
An open source project by Koj.
Furnish your home in style, for as low as CHF175/month →