From c3647394477465b6f67a8990803b2d9264509dfd Mon Sep 17 00:00:00 2001 From: mo-auto <54212639+mo-auto@users.noreply.github.com> Date: Mon, 15 Jul 2024 10:19:44 +0000 Subject: [PATCH] ci(workflows): sync central workflows Signed-off-by: mo-auto <54212639+mo-auto@users.noreply.github.com> --- .github/workflows/central_code_quality_check.yml | 11 +++++++---- .github/workflows/commit-check.yml | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/central_code_quality_check.yml b/.github/workflows/central_code_quality_check.yml index 8c486a46f8..8c0efd21fb 100644 --- a/.github/workflows/central_code_quality_check.yml +++ b/.github/workflows/central_code_quality_check.yml @@ -8,11 +8,14 @@ on: branches: - master - main + - "4.5" pull_request: branches: - master - main + - "4.5" workflow_dispatch: + jobs: build: runs-on: ubuntu-latest @@ -31,20 +34,20 @@ jobs: GluuFederation/gluu-admin-ui steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of sonarqube analysis - name: Set up JDK 11 if: contains(env.JVM_PROJECTS, github.repository) - uses: actions/setup-java@v3.3.0 + uses: actions/setup-java@v4.0.0 with: - java-version: '11' + java-version: 11 distribution: 'adopt' - name: Cache SonarCloud packages for JVM based project if: contains(env.JVM_PROJECTS, github.repository) - uses: actions/cache@v3.0.2 + uses: actions/cache@v4.0.2 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar diff --git a/.github/workflows/commit-check.yml b/.github/workflows/commit-check.yml index 682b4af9a7..030dea6ec2 100644 --- a/.github/workflows/commit-check.yml +++ b/.github/workflows/commit-check.yml @@ -20,16 +20,18 @@ jobs: check-commit-message: name: Check Commit Message runs-on: ubuntu-latest + steps: - name: Checkout Project - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: # We need to fetch with a depth of 2 for pull_request so we can do HEAD^2 fetch-depth: 2 - - uses: actions/setup-node@v3.1.1 + - uses: actions/setup-node@v4.0.3 with: node-version: 14 + - run: | npm install --save-dev @commitlint/{config-conventional,cli} echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js @@ -73,7 +75,6 @@ jobs: # pattern: '^.+(Resolves|Fixes): \#[0-9]+$' # error: 'You need at least one "Resolves|Fixes: #" line.' - - name: "[Push] Report Commit Standard Status" if: steps.push_get_commit_message.outcome != 'success' && github.event_name == 'push' run: | @@ -83,7 +84,7 @@ jobs: - name: "[Pull Request] Report Commit Standard Status" if: steps.pr_get_commit_message.outcome != 'success' && github.event_name == 'pull_request' run: | - curl -X POST -H 'Content-Type: application/json' --data '{"alias":"Mo-Auto","emoji":":robot:","text":":x: :cry: I am reporting a bad [commit](https://github.com/${{github.repository}}/tree/${{github.head_ref}}) by :thinking_face: @${{github.actor}} :x:","attachments":[{"title":"GitHub user behavior reporter","title_link":"https://www.conventionalcommits.org","text":"We are not too happy with your last commit merging into https://github.com/${{github.repository}}/tree/${{github.base_ref}}. Here is why : ${{ steps.pr_get_commit_message.outputs.errormsg }}","color":"#764FA5"}]}' ${{ secrets.GITHUBUSERBEHAVIORROCKETCHATREPORTER }} + curl -X POST -H 'Content-Type: application/json' --data '{"alias":"Mo-Auto","emoji":":robot:","text":":x: :cry: I am reporting a bad [commit](https://github.com/${{github.repository}}/tree/$GITHUB_HEAD_REF) by :thinking_face: @${{github.actor}} :x:","attachments":[{"title":"GitHub user behavior reporter","title_link":"https://www.conventionalcommits.org","text":"We are not too happy with your last commit merging into https://github.com/${{github.repository}}/tree/${{github.base_ref}}. Here is why : ${{ steps.pr_get_commit_message.outputs.errormsg }}","color":"#764FA5"}]}' ${{ secrets.GITHUBUSERBEHAVIORROCKETCHATREPORTER }} exit 1 # - name: Check Commit length