fix(action): allow forward sync from trailer commits
This commit is contained in:
14
action.yml
14
action.yml
@@ -38,21 +38,7 @@ runs:
|
||||
command -v "$cmd" &>/dev/null || { echo "::error::Missing required tool: $cmd"; exit 1; }
|
||||
done
|
||||
|
||||
- name: Loop guard (forward)
|
||||
id: guard
|
||||
if: inputs.direction == 'forward' || inputs.direction == 'both'
|
||||
shell: bash
|
||||
run: |
|
||||
TRAILER=$(yq '.bot.trailer' "${{ inputs.config }}" 2>/dev/null || echo "Josh-Sync-Origin")
|
||||
if git log -1 --format=%B | grep -q "^${TRAILER}:"; then
|
||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||
echo "::notice::Skipping sync — HEAD commit has sync trailer (loop prevention)"
|
||||
else
|
||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Sync
|
||||
if: steps.guard.outputs.skip != 'true'
|
||||
shell: bash
|
||||
env:
|
||||
JOSH_SYNC_DEBUG: ${{ inputs.debug == 'true' && '1' || '0' }}
|
||||
|
||||
Reference in New Issue
Block a user