Point CI workflows at main instead of master

This repository's default branch is main, but every workflow was still keyed to
master, so none of them could ever run:

- build-and-test.yml triggered on push/PR to master, so CI never fired and the
  README's build badge had no status to report.
- docker-publish.yml keyed off a successful build-and-test run on master, so it
  never fired either. Only trigger filters and comments referenced the branch;
  the tag-vs-branch logic was already branch-agnostic.
- make-release.yml actively refused to run, failing with "Regular releases can
  only be created from the 'master' branch."

Also updated the branch names throughout docs/DEVELOPMENT_WORKFLOW.md to match.
This commit is contained in:
purnell569 committed 2026-09-11 14:15:12 +09:30
1 parent 60f3a6d693
commit 9991962e86
4 files changed
+44 -44

No files matched your search

+3 -3
View File
@@ -1,14 +1,14 @@
name: Build and Test
# Build and test on PRs and master pushes
# Build and test on PRs and main pushes
# This workflow does NOT publish Docker images - that's handled by docker-publish.yml
on:
pull_request:
branches:
- master # PRs targeting trunk
- main # PRs targeting trunk
push:
branches:
- master # Direct pushes to master
- main # Direct pushes to main
paths-ignore:
- '.github/**' # Ignore GitHub config changes (workflows, actions, templates, etc.)
- 'README.md'
+9 -9
View File
@@ -1,19 +1,19 @@
name: Publish Docker Image
# Docker publishing workflow - gated by successful build-and-test completion
# This ensures images are only published after tests pass on master
# This ensures images are only published after tests pass on main
on:
# Triggered after successful build-and-test on master
# Triggered after successful build-and-test on main
# Note: The branches filter checks workflow_run.head_branch, which is the source branch
# of the triggering workflow. For PRs targeting master, head_branch is the PR source
# branch (not master), so this filter already excludes PR-triggered builds. Only direct
# pushes to master will have head_branch == 'master' and trigger this workflow.
# of the triggering workflow. For PRs targeting main, head_branch is the PR source
# branch (not main), so this filter already excludes PR-triggered builds. Only direct
# pushes to main will have head_branch == 'main' and trigger this workflow.
workflow_run:
workflows: ["Build and Test"]
types:
- completed
branches:
- master
- main
# Also trigger on version tags (v*) for releases
push:
tags:
@@ -59,13 +59,13 @@ jobs:
SHA_SHORT=$(git rev-parse --short HEAD)
TIMESTAMP=$(git log -1 --format=%cI)
# Determine if this is a tag build or master branch build
# Determine if this is a tag build or main branch build
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_type }}" == "tag" ]]; then
# For tag builds, use the git tag version (strip 'v' prefix)
VERSION="${GITHUB_REF#refs/tags/v}"
IS_TAG_BUILD="true"
else
# For master builds, use pom.xml version
# For main builds, use pom.xml version
VERSION="$POM_VERSION"
IS_TAG_BUILD="false"
fi
@@ -96,7 +96,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Tag rules:
# - For tag builds: version tag (from git tag) + sha tag
# - For master builds: latest + sha + version (if not SNAPSHOT)
# - For main builds: latest + sha + version (if not SNAPSHOT)
tags: |
type=raw,value=${{ steps.metadata.outputs.version }},enable=${{ steps.metadata.outputs.is_tag_build == 'true' }}
type=raw,value=latest,enable=${{ steps.metadata.outputs.is_tag_build == 'false' }}
+2 -2
View File
@@ -50,8 +50,8 @@ jobs:
if: ${{ github.event.inputs.is_prerelease != 'true' }}
run: |
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" != "master" ]; then
echo "❌ Error: Regular releases can only be created from the 'master' branch."
if [ "$BRANCH" != "main" ]; then
echo "❌ Error: Regular releases can only be created from the 'main' branch."
echo " Current branch: $BRANCH"
echo " To create a pre-release from this branch, check the 'Mark this as a pre-release' option."
exit 1