Fix workflow: restore infra files before merge

Because:
- Merge conflicts in infrastructure files caused manual intervention
- Upstream infra files must always be preferred to avoid drift

Moves 'Restore upstream infrastructure files' step before 'Merge upstream branch' in create-upstream-pr.yml. Ensures .github/workflows/ and cookbook/version_info.py are always restored from upstream before merging. No breaking changes. Affects .github/workflows/create-upstream-pr.yml only.
This commit is contained in:
smilerz
2025-07-18 11:00:08 -05:00
parent 2954334e1f
commit 871074ef45

View File

@@ -51,17 +51,11 @@ jobs:
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "✅ Created branch: $BRANCH_NAME"
- name: Merge upstream branch
id: merge_upstream
run: |
BRANCH_NAME="${{ steps.create_branch.outputs.branch_name }}"
git checkout "$BRANCH_NAME"
git merge --no-edit upstream/tandoor-1 || { echo "❌ Merge conflict detected during merge with upstream/tandoor-1. Please resolve conflicts manually."; exit 1; }
echo "✅ Merged upstream/tandoor-1 into $BRANCH_NAME"
- name: Restore upstream infrastructure files
id: restore_infra
run: |
BRANCH_NAME="${{ steps.create_branch.outputs.branch_name }}"
git checkout "$BRANCH_NAME"
git rm .gitattributes || echo " .gitattributes not present, skipping removal."
git checkout upstream/tandoor-1 -- .github/workflows/ || echo " No workflows to restore."
git checkout upstream/tandoor-1 -- cookbook/version_info.py || echo " No version_info.py to restore."
@@ -73,6 +67,14 @@ jobs:
echo " No infrastructure changes to commit."
fi
- name: Merge upstream branch
id: merge_upstream
run: |
BRANCH_NAME="${{ steps.create_branch.outputs.branch_name }}"
git checkout "$BRANCH_NAME"
git merge --no-edit upstream/tandoor-1 || { echo "❌ Merge conflict detected during merge with upstream/tandoor-1. Please resolve conflicts manually."; exit 1; }
echo "✅ Merged upstream/tandoor-1 into $BRANCH_NAME"
- name: Get commit list
id: get_commits
run: |