A GitHub action to determine the version for build artifacts.
version: The version string
CI/CD Build | Version |
---|---|
Git tag x.y.z on master branch (a prefixed "v" is okay, too) | X.Y.Z, X.Y, X, vX.Y.Z ... |
Untagged main commit | main-<runnumber>-<sha> |
Pull request | pr-<prnumber>-<runnumber>-<sha> |
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
branches: [ main ]
types: [published]
jobs:
action_outputs:
runs-on: ubuntu-latest
name: Echo action's outputs
steps:
- id: version
uses: riege/[email protected]
- run: |
echo Version: ${{ steps.version.outputs.version }}
echo Image tag: "${{ secrets.ACR_LOGIN_SERVER }}/my-container:${{ steps.version.outputs.version }}"