chore: update .github/workflows/sync-version-on-merge.yml from MokoStandards

This commit is contained in:
2026-04-09 10:51:15 -05:00
parent b608b00125
commit 4883345a79

View File

@@ -8,8 +8,8 @@
# DEFGROUP: GitHub.Workflow # DEFGROUP: GitHub.Workflow
# INGROUP: MokoStandards.Automation # INGROUP: MokoStandards.Automation
# REPO: https://github.com/mokoconsulting-tech/MokoStandards # REPO: https://github.com/mokoconsulting-tech/MokoStandards
# PATH: /templates/workflows/shared/sync-version-on-merge.yml.template # PATH: /templates/workflows/shared/sync-version-on-merge.yml
# VERSION: 04.06.00 # VERSION: 04.05.13
# BRIEF: Auto-bump patch version on every push to main and propagate to all file headers # BRIEF: Auto-bump patch version on every push to main and propagate to all file headers
# NOTE: Synced via bulk-repo-sync to .github/workflows/sync-version-on-merge.yml in all governed repos. # NOTE: Synced via bulk-repo-sync to .github/workflows/sync-version-on-merge.yml in all governed repos.
# README.md is the single source of truth for the repository version. # README.md is the single source of truth for the repository version.
@@ -17,10 +17,10 @@
name: Sync Version from README name: Sync Version from README
on: on:
pull_request: push:
types: [closed]
branches: branches:
- main - main
- master
workflow_dispatch: workflow_dispatch:
inputs: inputs:
dry_run: dry_run:
@@ -39,8 +39,6 @@ jobs:
sync-version: sync-version:
name: Propagate README version name: Propagate README version
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: >-
github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -67,7 +65,7 @@ jobs:
composer install --no-dev --no-interaction --quiet composer install --no-dev --no-interaction --quiet
- name: Auto-bump patch version - name: Auto-bump patch version
if: ${{ github.event_name != 'workflow_dispatch' && github.actor != 'github-actions[bot]' }} if: ${{ github.event_name == 'push' && github.actor != 'github-actions[bot]' }}
run: | run: |
if git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q '^README\.md$'; then if git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q '^README\.md$'; then
echo "README.md changed in this push — skipping auto-bump" echo "README.md changed in this push — skipping auto-bump"