Skip to content

Update workflow

Update workflow #33

name: 🧹 Remove ZeroPoint branding
on: [push]
jobs:
rebrand:
runs-on: ubuntu-latest
if: github.repository != 'MWDelaney/ZeroPoint'
steps:
- name: Get current branch name
run: |
echo "branch=$(echo '${{ github.ref }}' | awk -F '/' '{print $3}')" >> $GITHUB_OUTPUT
shell: bash
id: getBranch
- name: Get to the owner of this repository
run: echo "owner=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_OUTPUT
shell: bash
id: getOwner
- name: Get the repository name and convert it to lowercase
run: echo "slug=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
shell: bash
id: getSlug
- name: Get the repository name
run: echo "name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_OUTPUT
shell: bash
id: getName
- name: Checkout the repository
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ steps.getBranch.outputs.branch }}
- name: Replace owner
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "MWDelaney"
replace: ${{ steps.getOwner.outputs.owner }}
regex: false
- name: Replace repository name
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "ZeroPoint"
replace: ${{ steps.getSlug.outputs.name }}
regex: false
- name: Replace repository slug
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "zeropoint"
replace: ${{ steps.getName.outputs.slug }}
regex: false
- name: Archive template README.md
uses: canastro/copy-file-action@master
with:
source: "README.md"
target: "README.template.md"
- name: Replace with project README.md
uses: canastro/copy-file-action@master
with:
source: "README.ZeroPoint.md"
target: "README.md"
- name: Delete this workflow
run: rm .github/workflows/zeropoint-template.yml
- name: Commit changes and create a pull request
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: "remove-zeropoint-branding"
create_branch: true
commit_message: "Remove ZeroPoint branding"