build(rename.yml): add action to rename package #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rename package | |
| env: | |
| PACKAGE_NAME: python_package_template | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| rename: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Check if the old package name still exists. | |
| - name: Check for old package name | |
| id: check_name | |
| run: | | |
| if grep -r '${{env.PACKAGE_NAME}}' .; then | |
| echo "found=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "found=false" >> $GITHUB_OUTPUT | |
| fi | |
| # Only run the rename action if the old package name is found. | |
| - name: Rename using github-template-rename-action | |
| if: steps.check_name.outputs.found == 'true' | |
| uses: kota65535/github-template-rename-action@v1 | |
| with: | |
| from-name: ${{env.PACKAGE_NAME}} |