From 12257749724afce52b5e384001deb77a4dd24a59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 22 Oct 2022 13:03:36 +0200 Subject: [PATCH] Use github event in more github actions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 6 ++++-- .github/workflows/generate-typedoc.yml | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ee63b19..cdeb9183 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - master + - ${{ github.event.repository.default_branch }} pull_request: types: [opened, synchronize, reopened] workflow_dispatch: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3e61d69e..719e5743 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,12 @@ name: 'CodeQL' on: push: - branches: [master] + branches: + - ${{ github.event.repository.default_branch }} pull_request: # The branches below must be a subset of the branches above - branches: [master] + branches: + - ${{ github.event.repository.default_branch }} schedule: - cron: '44 9 * * 3' diff --git a/.github/workflows/generate-typedoc.yml b/.github/workflows/generate-typedoc.yml index 93d5c23b..f69969a1 100644 --- a/.github/workflows/generate-typedoc.yml +++ b/.github/workflows/generate-typedoc.yml @@ -25,14 +25,14 @@ jobs: npm run typedoc - name: Commit files - if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/master'" + if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'" run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git commit -m "Generate TypeDoc" -a - name: Push changes - if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/master'" + if: "github.repository == 'poolifier/poolifier' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'" uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} -- 2.34.1