chore(ci): update CI to work better with conventional commits #454

Merged
luke merged 2 commits from chore/conventional-commits into main 2025-01-02 21:26:52 +01:00
2 changed files with 30 additions and 18 deletions

View File

@ -0,0 +1,27 @@
name: "Enforce Conventional Commit PR Title"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
- labeled
- unlabeled
jobs:
validate:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
with:
requireScope: true
wip: true
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: true
githubBaseUrl: https://git.tainton.uk/api/v1
ignoreLabels: ignore-semantic-pull-request

View File

@ -77,6 +77,8 @@ jobs:
with: with:
git-url: ${{ steps.set_srvurl.outputs.srvurl }} git-url: ${{ steps.set_srvurl.outputs.srvurl }}
github-token: ${{ gitea.token }} github-token: ${{ gitea.token }}
preset: "conventionalcommits"
# preset: "angular" # This is the default
skip-commit: true skip-commit: true
release-count: 1 release-count: 1
output-file: false output-file: false
@ -157,24 +159,7 @@ jobs:
annotations: ${{ steps.meta.outputs.annotations }} annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
# - name: Build images
# run: |
# bldcmd="docker buildx build --load"
# strtags="${{ steps.meta.outputs.tags }}"
# strlabels="${{ steps.meta.outputs.labels }}"
# strannotations="${{ steps.meta.outputs.annotations }}"
# readarray -t tags <<<"$strtags"
# readarray -t labels <<<"$strlabels"
# readarray -t annotations <<<"$strannotations"
# for element in "${tags[@]}"; do bldcmd="$bldcmd --tag \"$element\""; done
# for element in "${labels[@]}"; do bldcmd="$bldcmd --label \"$element\""; done
# for element in "${annotations[@]}"; do bldcmd="$bldcmd --annotation \"$element\""; done
# bldcmd="$bldcmd ${{ gitea.workspace }}"
# echo "$bldcmd"
# echo ""
# sh -c "$bldcmd"
- name: Push images - name: Push images
run: | run: |
strtags="${{ steps.meta.outputs.tags }}" strtags="${{ steps.meta.outputs.tags }}"