OCMP-0 adding velocity action

This commit is contained in:
Milorad Jovanovic 2025-03-27 15:55:10 +00:00
parent 05339c28e3
commit 96fe74c1f1

47
action.yml Normal file
View File

@ -0,0 +1,47 @@
name: "Ocamba Velocity Integration API Caller"
description: "Calls the Ocamba Velocity Integration API with the required parameters."
inputs:
owner:
description: "Repository owner (mandatory)"
required: true
repo:
description: "Repository name (mandatory)"
required: true
sha:
description: "Optional commit SHA"
required: false
env:
description: "Optional environment. Set to 'dev' for development; defaults to production."
required: false
default: "prod"
token:
description: "Bearer token for Authorization header (mandatory)"
required: true
runs:
using: "composite"
steps:
- name: Determine API Domain
shell: bash
run: |
if [ "${{ inputs.env }}" = "dev" ]; then
VELOCITY_API_DOMAIN="dev-api.ocamba.com"
else
VELOCITY_API_DOMAIN="api.ocamba.com"
fi
# Export API_DOMAIN so it's available in subsequent steps
echo "VELOCITY_API_DOMAIN=$VELOCITY_API_DOMAIN" >> $GITHUB_ENV
- name: Call Ocamba Velocity Integration API
shell: bash
run: |
URL="https://${VELOCITY_API_DOMAIN}/v1/velocity/integration?owner=${{ inputs.owner }}&repo=${{ inputs.repo }}"
# Append sha parameter if provided
if [ -n "${{ inputs.sha }}" ]; then
URL="${URL}&sha=${{ inputs.sha }}"
fi
curl -X GET "${URL}" -H "Authorization: Bearer ${{ inputs.token }}"