Files
package-version-action/README.md
Anand Chowdhary 2f3b5265cc 🔧 Update package metadata
2021-01-03 22:46:38 +05:30

2.2 KiB

🔖 Package Version Action

GitHub Action to get the package.json version and a SHA suffix for unique versions.

Build CI Test CI Release CI Node CI

Get started

This Action returns a recommend image name. For example, if you want to publish a new Docker image:

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: actions/cache@v2
      - name: Build and push to Docker
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: username/anand:v${{ steps.package-version.outputs.package-version-short-hash }}

Outputs

Output name Example value
package-version v2.23.1
package-version-timestamp v2.23.1-1609693587
short-hash 1abc9c3
package-version-short-hash v2.23.1-1abc9c3

📄 License

  • Code: MIT © Koj
  • "GitHub" is a trademark of GitHub, Inc.

Koj

An open source project by Koj.
Furnish your home in style, for as low as CHF175/month →