2
0

refactor: simplify vault trigger to use version tags
All checks were successful
Trigger Vault Plugin Rebuild / Trigger Vault Rebuild (push) Successful in 0s
Build and Release / Lint (push) Successful in 5m2s
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 3m1s
Build and Release / Build Binaries (amd64, darwin, linux-latest) (push) Successful in 3m14s
Build and Release / Unit Tests (push) Successful in 4m7s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 3m43s
Build and Release / Build Binaries (arm64, darwin, linux-latest) (push) Successful in 2m55s
Build and Release / Build Binaries (arm64, linux, linux-latest) (push) Successful in 2m29s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 8h7m31s

No longer need pseudo-version calculation since the vault now uses
proper version tags directly.
This commit is contained in:
2026-01-17 17:30:19 -05:00
parent eb81050b66
commit 359ba949cd

View File

@@ -13,49 +13,19 @@ jobs:
name: Trigger Vault Rebuild
runs-on: linux-latest
steps:
- name: Checkout for commit info
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Calculate pseudo-version
id: version
run: |
TAG="${{ github.ref_name }}"
SHA="${{ github.sha }}"
SHORT_SHA="${SHA:0:12}"
# Get actual commit timestamp in UTC format YYYYMMDDHHMMSS
# This MUST match the commit timestamp for Go pseudo-versions to work
TIMESTAMP=$(git log -1 --format='%cd' --date=format-local:'%Y%m%d%H%M%S' "$SHA")
# Go pseudo-version format: v0.0.0-YYYYMMDDHHMMSS-12charcommit
PSEUDO_VERSION="v0.0.0-${TIMESTAMP}-${SHORT_SHA}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
echo "pseudo_version=$PSEUDO_VERSION" >> "$GITHUB_OUTPUT"
echo "Server tag: $TAG"
echo "Server SHA: $SHA"
echo "Commit timestamp: $TIMESTAMP"
echo "Pseudo-version: $PSEUDO_VERSION"
- name: Trigger vault rebuild
run: |
echo "Triggering vault rebuild for server ${{ steps.version.outputs.tag }}"
TAG="${{ github.ref_name }}"
echo "Triggering vault rebuild for server $TAG"
# Use workflow_dispatch API: /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
# Use workflow_dispatch API
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
-H "Authorization: token ${{ secrets.VAULT_DISPATCH_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"ref": "main",
"inputs": {
"server_tag": "${{ steps.version.outputs.tag }}",
"server_sha": "${{ steps.version.outputs.sha }}",
"server_pseudo_version": "${{ steps.version.outputs.pseudo_version }}"
"server_tag": "'"$TAG"'"
}
}' \
"https://direct.git.marketally.com/api/v1/repos/${{ env.VAULT_REPO }}/actions/workflows/server-release.yml/dispatches")