From 340031e7ac899a66d7c95596890e091942e7622c Mon Sep 17 00:00:00 2001 From: Jairo Panduro Date: Mon, 15 Apr 2024 19:26:35 +0200 Subject: [PATCH] fix: STRF-11934 Separate Github PR Title check --- .github/workflows/pull_request_review.yml | 17 +++--------- .../workflows/pull_request_title_check.yml | 27 +++++++++++++++++++ .github/workflows/release.yml | 4 +-- .github/workflows/release_image.yml | 2 +- 4 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/pull_request_title_check.yml diff --git a/.github/workflows/pull_request_review.yml b/.github/workflows/pull_request_review.yml index b282b5dd..9bda0597 100644 --- a/.github/workflows/pull_request_review.yml +++ b/.github/workflows/pull_request_review.yml @@ -1,6 +1,3 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - name: Tests on: @@ -20,25 +17,17 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} + cache: 'npm' - name: Install Dependencies run: npm ci - - name: Verify Github PR Title TEST - run: echo '${{ env.TITLE }}' - - - name: Verify Github PR Title - run: echo '${{ env.TITLE }}' | npx commitlint - - - name: Verify Git Commit Name - run: git log -1 --pretty=format:"%s" | npx commitlint - - name: Lint the code run: npm run lint diff --git a/.github/workflows/pull_request_title_check.yml b/.github/workflows/pull_request_title_check.yml new file mode 100644 index 00000000..8cae3ad6 --- /dev/null +++ b/.github/workflows/pull_request_title_check.yml @@ -0,0 +1,27 @@ + +name: Pull Request Title Check + +on: + pull_request: + branches: [master, main] + +jobs: + check-pr-title: + env: + TITLE: ${{ github.event.pull_request.title }} + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'npm' + - name: Install Dependencies + run: npm ci + + - name: Verify Github PR Title + run: echo $TITLE | npx commitlint + + - name: Verify Git Commit Name + run: git log -1 --pretty=format:"%s" | npx commitlint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9615bbc..8f8697fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '18.x' - run: npm i diff --git a/.github/workflows/release_image.yml b/.github/workflows/release_image.yml index 7229c05f..852fc0d3 100644 --- a/.github/workflows/release_image.yml +++ b/.github/workflows/release_image.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to the Container registry uses: docker/login-action@v2