From 89387d097d1e2a83029e2c6b484598163a884b1b Mon Sep 17 00:00:00 2001 From: Diego Juliao Date: Mon, 28 Oct 2024 20:52:22 -0500 Subject: [PATCH] ci: squash pr commits --- .github/actions/setup/action.yml | 6 ++++++ .github/workflows/enforce-semantic-commits.yml | 12 +++++++++--- .github/workflows/publishment.yml | 6 ------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 0754b2a7..e94743b6 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -24,6 +24,12 @@ runs: echo "NODE_VERSION=${{ inputs.node-version }}" >> $GITHUB_ENV fi + - name: git config + shell: bash + run: | + git config user.name "ngx-deploy-npm bot" + git config user.email "-" + - name: Use Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/enforce-semantic-commits.yml b/.github/workflows/enforce-semantic-commits.yml index c4c474c6..cd398564 100644 --- a/.github/workflows/enforce-semantic-commits.yml +++ b/.github/workflows/enforce-semantic-commits.yml @@ -34,8 +34,10 @@ jobs: PR_TITLE='${{ github.event.pull_request.title }}' echo "PR TITLE": '$PR_TITLE' echo "$PR_TITLE" | npx commitlint + echo "::set-output name=pr_title::$PR_TITLE" generate-changelog: + needs: [check-pr-title] name: Generate Changelog #? should we comment in the PR? runs-on: ubuntu-latest steps: @@ -44,7 +46,11 @@ jobs: fetch-depth: 0 - uses: ./.github/actions/setup - - name: Generate Changelog + - name: Generate tmp branch + run: git checkout -b changelog + + - name: Squash commits run: | - git checkout -b changelog - npx nx version ngx-deploy-npm --dry-run + git reset --soft `git merge-base main HEAD` + git commit -m "${{ steps.check-title.outputs.pr_title }}" + git log diff --git a/.github/workflows/publishment.yml b/.github/workflows/publishment.yml index b83feca0..2fe1f3cf 100644 --- a/.github/workflows/publishment.yml +++ b/.github/workflows/publishment.yml @@ -53,12 +53,6 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - - name: git config - shell: bash - run: | - git config user.name "Github Actions" - git config user.email "-" - - uses: ./.github/actions/download-build - name: Check npm credentials