From 4fc6de0dd4b6e6c175c278c8c23843e5820384cf Mon Sep 17 00:00:00 2001 From: Marcos Oliveira Date: Mon, 20 Nov 2023 16:37:36 -0300 Subject: [PATCH] feat: add github action to change username and email --- .github/workflows/pre-deploy-mintlify.yml | 33 +++++++++++++++++++++++ 1 file changed, 33 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..d61a6fd --- /dev/null +++ b/.github/workflows/pre-deploy-mintlify.yml @@ -0,0 +1,33 @@ +name: "Pre-deploy Mintlify" + +on: + push: + branches: + - main + - test-gh-action + +jobs: + release: + name: Change email + runs-on: ubuntu-latest + steps: + - name: 🏗 Checkout files + uses: actions/checkout@v3 + with: + fetch-depth: 0 + # token: ${{ env.GH_TOKEN }} + + - 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