From d17ef19bd2f725b85a38e58de96db4e9eac8b50d Mon Sep 17 00:00:00 2001 From: linty Date: Wed, 30 Oct 2024 08:30:28 +0800 Subject: [PATCH] ci: change ci --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d019b5b..5623233 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,6 @@ name: CI on: push: branches: - - main - staging tags: - 'v*' @@ -11,10 +10,10 @@ on: types: [opened, synchronize, reopened] branches: - main - - staging jobs: test: + if: github.event_name != 'pull_request' || github.event.pull_request.base.ref == 'main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -34,6 +33,7 @@ jobs: if: success() lint: + if: github.event_name != 'pull_request' || github.event.pull_request.base.ref == 'main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -44,6 +44,7 @@ jobs: version: latest security: + if: github.event_name != 'pull_request' || github.event.pull_request.base.ref == 'main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -52,12 +53,13 @@ jobs: uses: snyk/actions/golang@master env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository - name: Run CodeQL Analysis uses: github/codeql-action/analyze@v2 sonarcloud: + if: github.event_name != 'pull_request' || github.event.pull_request.base.ref == 'main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3