From 8f454a0282c7e4636edbeaf268d0c325f2365a32 Mon Sep 17 00:00:00 2001 From: Fesaa <77553571+Fesaa@users.noreply.github.com> Date: Thu, 13 Mar 2025 15:21:10 +0000 Subject: [PATCH] [skip ci] Fix GitHub actions (#3625) --- .github/workflows/codeql.yml | 7 ++++--- .github/workflows/openapi-gen.yml | 15 ++++++--------- .github/workflows/pr-check.yml | 2 -- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 391776dd8..e2da33628 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,9 +48,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install Swashbuckle CLI - shell: bash - run: dotnet tool install -g Swashbuckle.AspNetCore.Cli + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/openapi-gen.yml b/.github/workflows/openapi-gen.yml index 28897acf8..45446d045 100644 --- a/.github/workflows/openapi-gen.yml +++ b/.github/workflows/openapi-gen.yml @@ -14,14 +14,11 @@ jobs: generate-openapi: runs-on: ubuntu-latest # Only run on direct pushes to develop, not PRs - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.repository_owner == 'Kareadita' steps: - name: Checkout code uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.REPO_GHA_PAT }} - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -60,12 +57,12 @@ jobs: run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - + + git commit -m "Update OpenAPI documentation" openapi.json + # Pull latest changes with rebase to avoid merge commits git pull --rebase origin develop - - # Commit and push - git commit -m "Update OpenAPI documentation" openapi.json + git push env: - GITHUB_TOKEN: ${{ secrets.REPO_GHA_PAT }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.REPO_GHA_PAT }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 7243968dc..51589221f 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -1,8 +1,6 @@ name: Validate PR Body on: - push: - branches: '**' pull_request: branches: [ main, develop, canary ] types: [synchronize]