0
0
reusable-workflows/.gitea/workflows/getReleaseChannel.yaml
2025-05-20 09:35:41 +02:00

40 lines
1.1 KiB
YAML

name: Get Release Channel
on:
workflow_call:
inputs:
repo:
required: true
type: string
tag:
required: true
type: string
outputs:
buildChannel:
description: "The current Release Build channel"
value: ${{ jobs.read.outputs.buildChannel }}
jobs:
read:
runs-on: ubuntu-latest
outputs:
buildChannel: ${{ steps.readRelease.outputs.buildChannel }}
steps:
- id: readRelease
run: |
GITEA_API_URL="https://gitea.greyhound-software.com/api/v1"
OWNER="greyhound"
API_TOKEN=${{ vars.PAT_TOKEN }}
### RELEASE ###
# Read Release and Extract the ID
tag=$(echo "${{ inputs.tag }}" | sed 's/\//%2F/g')
release=$(curl -s -H "Authorization: token $API_TOKEN" \
"$GITEA_API_URL/repos/$OWNER/${{ inputs.repo }}/releases/tags/$tag")
echo "Release Read $release"
release_body=$(echo $release | jq -r '.body')
echo "Release Body $release_body"
echo "buildChannel=$buildChannel" >> $GITHUB_OUTPUT