Skip to content

Commit

Permalink
Use short sha and fix body
Browse files Browse the repository at this point in the history
  • Loading branch information
cutoffthetop committed Feb 26, 2024
1 parent 182abd9 commit eb99720
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,22 @@ jobs:
bot_name: RKIMetadataExchange
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
template_ref=$(git ls-remote ${template_url} --heads main --exit-code | awk '{print $1;}')
template_ref=$(git ls-remote ${template_url} --heads main --exit-code | cut -f6)
git checkout -b cruft/cookiecutter-template-${template_ref} origin/main
git branch --set-upstream-to origin/cruft/cookiecutter-template-${template_ref}
cruft update --skip-apply-ask
printf '# Changes\n\n - updated cookiecutter template to %s\n' "$template_ref" > .cruft-pr-body
printf '# Changes\n\n - bumped cookiecutter template to %s\n' "$template_ref" > .cruft-pr-body
if [[ $(git status --porcelain | wc -c) -ne 0 ]]; then
printf '# Conflicts\n\n' >> .cruft-pr-body
fi
git status --porcelain | grep .rej | awk '{print $2;}' | while read -r line ; do
printf '\n```%s\n```\n' "$line" >> .cruft-pr-body
printf '\n```' >> .cruft-pr-body
cat ${line} >> .cruft-pr-body
printf '```\n' >> .cruft-pr-body
done
git add --all --verbose
git config --global user.email ${bot_email}
git config --global user.name ${bot_name}
git commit --message "Update cruft template to $template_ref" --verbose
git commit --message "Bump cookiecutter template to $template_ref" --verbose
git push origin --force --verbose
gh pr create --title "Update cookiecutter template to $template_ref" --body-file .cruft-pr-body --label cruft --assignee ${bot_user}
gh pr create --title "Bump cookiecutter template to $template_ref" --body-file .cruft-pr-body --label cruft --assignee ${bot_user}

0 comments on commit eb99720

Please sign in to comment.