From e82d2defc3780a75f98f29b78814d9f8fe1928f2 Mon Sep 17 00:00:00 2001 From: Fernando Daciuk Date: Mon, 20 Nov 2023 16:58:04 -0300 Subject: [PATCH] feat: add gh action to change commit author --- .github/workflows/pre-deploy-mintlify.yml | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pre-deploy-mintlify.yml diff --git a/.github/workflows/pre-deploy-mintlify.yml b/.github/workflows/pre-deploy-mintlify.yml new file mode 100644 index 0000000..7378b2c --- /dev/null +++ b/.github/workflows/pre-deploy-mintlify.yml @@ -0,0 +1,29 @@ +name: "Pre-deploy Mintlify" + +on: + push: + branches: + - main + +jobs: + release: + name: Change email + runs-on: ubuntu-latest + steps: + - name: 🏗 Checkout files + uses: actions/checkout@v3 + + - name: 🔧 Configure Git + run: | + git config --global user.name "Marcos Oliveira" + git config --global user.email "vmarcosp.pereira@gmail.com" + git filter-branch --commit-filter ' + if [ "$GIT_AUTHOR_EMAIL" != "vmarcosp.pereira@gmail.com" ]; + then + GIT_AUTHOR_NAME="Marcos Oliveira"; + GIT_AUTHOR_EMAIL="vmarcosp.pereira@gmail.com"; + git commit-tree "$@"; + else + git commit-tree "$@"; + fi' HEAD + git push origin ${GITHUB_REF##*/} -f