You've already forked hotpocket
BTHLABS-0000: development workflow
Co-authored-by: Tomek Wójcik <labs@tomekwojcik.pl> Co-committed-by: Tomek Wójcik <labs@tomekwojcik.pl>
This commit is contained in:
27
.gitea/actions/get-service-version/action.yaml
Normal file
27
.gitea/actions/get-service-version/action.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
name: "Get Run Info"
|
||||
description: "Sanitizies and unifies the environment into run info"
|
||||
inputs:
|
||||
service:
|
||||
description: "The service to work on"
|
||||
required: true
|
||||
outputs:
|
||||
version:
|
||||
description: "Service version"
|
||||
build-number:
|
||||
description: "Build number"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Compute Service Version"
|
||||
shell: "bash"
|
||||
run: |
|
||||
set -x
|
||||
if [[ ! -z "${GITHUB_HEAD_REF}" || "${GITHUB_REF_NAME}" = "development" ]]; then
|
||||
VERSION="${GITHUB_SHA::8}"
|
||||
BUILD="${GITHUB_RUN_NUMBER}"
|
||||
else
|
||||
VERSION="v$(grep -Po '(?<=^version\s=\s")[^"]+' services/${{ inputs.service }}/pyproject.toml)"
|
||||
BUILD="01"
|
||||
fi
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "build-number=$BUILD" >> $GITHUB_OUTPUT
|
||||
Reference in New Issue
Block a user