Skip to content

Commit

Permalink
feature/Configure git in pre step
Browse files Browse the repository at this point in the history
  • Loading branch information
cutoffthetop committed Mar 4, 2024
1 parent 20c63b9 commit 980f563
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,29 @@ jobs:
- name: Install requirements
run: make setup

- name: Update template
- name: Configure git
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PUB: ${{ secrets.SIGNING_PUB }}
run: |
mkdir -p 700 ~/.ssh
echo $SIGNING_PUB >> ~/.ssh/mex.pub
chmod 644 ~/.ssh/mex.pub
echo $SIGNING_KEY >> ~/.ssh/mex
chmod 600 ~/.ssh/mex
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/mex
ls -lah ~/.ssh
ssh-add -L
git config --local user.email ${{ vars.MEX_BOT_EMAIL }}
git config --local user.name ${{ vars.MEX_BOT_USER }}
git config --local gpg.format ssh
git config --local user.signingkey ~/.ssh/mex.pub
git config --local commit.gpgsign true
- name: Update template
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
run: |
if cruft check; then
echo template is up to date
Expand All @@ -71,21 +89,7 @@ jobs:
printf '```\n' >> .cruft-pr-body
done
git add --all --verbose
mkdir -p 700 ~/.ssh
echo $SIGNING_PUB >> ~/.ssh/mex.pub
chmod 644 ~/.ssh/mex.pub
echo $SIGNING_KEY >> ~/.ssh/mex
chmod 600 ~/.ssh/mex
ssh-add ~/.ssh/mex
ls -lah ~/.ssh
ssh-add -L
git config --local user.email ${{ vars.MEX_BOT_EMAIL }}
git config --local user.name ${{ vars.MEX_BOT_USER }}
git config --local gpg.format ssh
git config --local user.signingkey ~/.ssh/mex.pub
git config --local commit.gpgsign true
git commit --message "Bump cookiecutter template to $template_ref" --verbose
git push --set-upstream origin cruft/cookiecutter-template-${template_ref} --force --verbose
gh pr create --title "Bump cookiecutter template to $template_ref" --body-file .cruft-pr-body --label cruft --assignee ${{ vars.MEX_BOT_USER }}
rm -rf ~/.ssh/mex ~/.ssh/mex.pub
exit 1

0 comments on commit 980f563

Please sign in to comment.