chore: refine release prioritization logic and bump v1.7.8
All checks were successful
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 2s
Monorepo Pipeline / 🧹 Lint (push) Successful in 1m0s
Monorepo Pipeline / 🧪 Test (push) Successful in 39s
Monorepo Pipeline / 🏗️ Build (push) Successful in 2m23s
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Successful in 19s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m42s
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Successful in 2m17s
Monorepo Pipeline / 🐳 Build Production Runtime (push) Successful in 16s
Monorepo Pipeline / 🐳 Build Build-Base (push) Successful in 5m29s
All checks were successful
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 2s
Monorepo Pipeline / 🧹 Lint (push) Successful in 1m0s
Monorepo Pipeline / 🧪 Test (push) Successful in 39s
Monorepo Pipeline / 🏗️ Build (push) Successful in 2m23s
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Successful in 19s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m42s
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Successful in 2m17s
Monorepo Pipeline / 🐳 Build Production Runtime (push) Successful in 16s
Monorepo Pipeline / 🐳 Build Build-Base (push) Successful in 5m29s
This commit is contained in:
@@ -19,23 +19,38 @@ jobs:
|
|||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 🛑 Cancel Redundant Runs
|
- name: 🛑 Cancel Redundant Runs
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
RUN_ID: ${{ github.run_id }}
|
RUN_ID: ${{ github.run_id }}
|
||||||
|
REF: ${{ github.ref }}
|
||||||
|
REF_NAME: ${{ github.ref_name }}
|
||||||
|
EVENT: ${{ github.event_name }}
|
||||||
run: |
|
run: |
|
||||||
echo "🚀 Release detected. Cancelling non-tag runs..."
|
echo "🔎 Debug: Event=$EVENT, Ref=$REF, RefName=$REF_NAME, RunId=$RUN_ID"
|
||||||
# Get all runs for this repo
|
|
||||||
RUNS=$(curl -s -H "Authorization: token $GITEA_TOKEN" "https://git.infra.mintel.me/api/v1/repos/$REPO/actions/runs")
|
|
||||||
|
|
||||||
# Iterate and cancel in_progress/queued non-tag runs
|
if [[ "$REF" == refs/tags/v* ]]; then
|
||||||
echo "$RUNS" | jq -c '.workflow_runs[] | select(.status == "in_progress" or .status == "queued") | select(.id | tostring != "'$RUN_ID'") | select(.event != "push" or .ref | contains("refs/tags/v") | not)' | while read run; do
|
echo "🚀 Release detected ($REF_NAME). Cancelling non-tag runs..."
|
||||||
ID=$(echo "$run" | jq -r '.id')
|
|
||||||
DESC=$(echo "$run" | jq -r '.display_title')
|
# Fetch all runs
|
||||||
echo "🛑 Cancelling redundant run $ID ($DESC)..."
|
RUNS=$(curl -s -H "Authorization: token $GITEA_TOKEN" "https://git.infra.mintel.me/api/v1/repos/$REPO/actions/runs")
|
||||||
curl -X POST -s -H "Authorization: token $GITEA_TOKEN" "https://git.infra.mintel.me/api/v1/repos/$REPO/actions/runs/$ID/cancel"
|
|
||||||
done
|
# Identify runs to cancel: in_progress/queued, NOT this run, and NOT a tag run
|
||||||
|
echo "$RUNS" | jq -c '.workflow_runs[] | select(.status == "in_progress" or .status == "queued") | select(.id | tostring != "'$RUN_ID'")' | while read -r run; do
|
||||||
|
ID=$(echo "$run" | jq -r '.id')
|
||||||
|
RUN_REF=$(echo "$run" | jq -r '.ref')
|
||||||
|
TITLE=$(echo "$run" | jq -r '.display_title')
|
||||||
|
|
||||||
|
if [[ "$RUN_REF" != refs/tags/v* ]]; then
|
||||||
|
echo "🛑 Cancelling redundant branch run $ID ($TITLE) on $RUN_REF..."
|
||||||
|
curl -X POST -s -H "Authorization: token $GITEA_TOKEN" "https://git.infra.mintel.me/api/v1/repos/$REPO/actions/runs/$ID/cancel"
|
||||||
|
else
|
||||||
|
echo "⏭️ Skipping parallel release run $ID ($TITLE) on $RUN_REF"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "ℹ️ Regular push. No prioritazation needed."
|
||||||
|
fi
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: 🧹 Lint
|
name: 🧹 Lint
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/next-utils",
|
"name": "@mintel/next-utils",
|
||||||
"version": "1.7.7",
|
"version": "1.7.8",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
Reference in New Issue
Block a user