Skip to content

Commit a888467

Browse files
Update template_update.yml
1 parent 3fad34b commit a888467

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/template_update.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,41 +110,41 @@ jobs:
110110
shell: bash
111111
run: |
112112
set -euo pipefail
113-
113+
114114
RENDERED="/tmp/rendered/${{ steps.rendered_dir.outputs.name }}"
115115
OLD_SHA="${{ needs.check-update.outputs.old_sha }}"
116116
NEW_SHA="${{ needs.check-update.outputs.new_sha }}"
117117
BRANCH="template-update-${NEW_SHA}"
118-
118+
119119
git config user.name "GitHub Actions Bot"
120120
git config user.email "actions@github.com"
121-
121+
122122
# Save current branch name
123123
CURRENT_BRANCH="${{ inputs.repo_branch }}"
124-
124+
125125
# Create an orphan branch with the rendered template content
126126
git checkout --orphan template-rendered
127127
git rm -rf --cached .
128128
rm -rf $(ls -A | grep -v '^\.git$')
129-
129+
130130
# Copy rendered content
131131
cp -r "$RENDERED"/. .
132-
132+
133133
# Preserve .cookiecutter.json from original branch with updated SHA
134134
git show "${CURRENT_BRANCH}:.cookiecutter.json" > .cookiecutter.json
135135
jq ".cookiecutter.template_sha = \"${NEW_SHA}\"" \
136136
.cookiecutter.json > tmp.json && mv tmp.json .cookiecutter.json
137-
137+
138138
git add -A
139139
git commit -m "Template render at ${NEW_SHA}"
140-
140+
141141
# Save the commit SHA of template-rendered
142142
TEMPLATE_COMMIT=$(git rev-parse HEAD)
143-
143+
144144
# Switch back to repo branch and create update branch
145145
git checkout "${CURRENT_BRANCH}"
146146
git checkout -b "$BRANCH"
147-
147+
148148
# Merge using the commit SHA instead of branch name
149149
if git merge "$TEMPLATE_COMMIT" --allow-unrelated-histories --no-edit -m "chore: update from template ${OLD_SHA} → ${NEW_SHA}"; then
150150
echo "merge_had_conflicts=false" >> "$GITHUB_OUTPUT"
@@ -154,7 +154,7 @@ jobs:
154154
git add -A
155155
git commit -m "chore: update from template ${OLD_SHA} → ${NEW_SHA} (with conflicts)"
156156
fi
157-
157+
158158
git push origin "$BRANCH"
159159
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
160160

0 commit comments

Comments
 (0)