Skip to content

fix: update dependency black to v24.10.0 (#1158) #1125

fix: update dependency black to v24.10.0 (#1158)

fix: update dependency black to v24.10.0 (#1158) #1125

---
name: Initialize Repository
on:
push:
branches:
- main
permissions:
contents: write
issues: write
jobs:
setup:
if: ${{ ! contains(github.repository, 'template') }}
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
- name: Setup labels for the repository
run: gh label clone inovintell/py-template --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update repository name
uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97 # tag=v2
with:
file: cookiecutter.json
field: repository
value: ${{ github.event.repository.name }}
- name: Update repository owner
uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97 # tag=v2
with:
file: cookiecutter.json
field: repository_owner
value: ${{ github.repository_owner }}
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.x
- name: Install cookiecutter
run: pip install cookiecutter
- name: Hack cookiecutter to work with GH Actions
id: hack
working-directory: ${{ github.workspace }}/../
run: |
rm ${{ github.event.repository.name }}/.github/workflows/initialization.yml
mv ${{ github.event.repository.name }}/cookiecutter.json ./
mv ${{ github.event.repository.name }} '{{cookiecutter.repository}}'
echo "working_directory=$(pwd)" >> $GITHUB_OUTPUT
- name: Create repo from template
working-directory: ${{ steps.hack.outputs.working_directory }}/../
run: >
cookiecutter --verbose --no-input
${{ github.event.repository.name }}
--output-dir ./${{ github.event.repository.name }}
- name: Push changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_message: 'fix: setup template repository [skip ci]'
add_options: --all
push_options: --force