Skip to content

simplify actions

simplify actions #3

Workflow file for this run

on:
push:
branches:
- '**'
tags:
- '**'
permissions:
contents: write
packages: write
jobs:
split:
runs-on: self-arm
name: split
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Determine ref
shell: bash
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
tag="${GITHUB_REF#refs/tags/}"
echo "branch=${GITHUB_REF}" >> "${GITHUB_OUTPUT}"
echo "ref_type=tag" >> "${GITHUB_OUTPUT}"
echo "tag=${tag}" >> "${GITHUB_OUTPUT}"
else
echo "branch=${GITHUB_REF#refs/heads/}" >> "${GITHUB_OUTPUT}"
echo "ref_type=branch" >> "${GITHUB_OUTPUT}"
fi
id: branch
- name: Split
id: splitsh
uses: docker://ghcr.io/960018/action-split:latest
env:
BRANCH: ${{ steps.branch.outputs.branch }}
REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
COMPONENTS_JSON_PATH: .github/deploy/${{ steps.branch.outputs.ref_type == 'tag' && 'components.json' || 'components-modified.json' }}
EXCLUDE_TESTS: true
- name: Remove tag from monorepo
if: ${{ steps.branch.outputs.ref_type == 'tag' }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TAG_NAME: ${{ steps.branch.outputs.tag }}
run: |
status=$(curl -s -o /tmp/delete_tag_response -w "%{http_code}" \
-X DELETE \
-H "Authorization: Bearer ${GH_TOKEN}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/git/refs/tags/${TAG_NAME}")
if [[ "${status}" != "204" ]]; then
echo "Failed to delete tag (status: ${status})"
cat /tmp/delete_tag_response
exit 1
fi
rm -f /tmp/delete_tag_response