From 70dd3f0eb6eed69a3b8f25a35a285192a3312401 Mon Sep 17 00:00:00 2001 From: Hugo Bollon Date: Thu, 5 Sep 2024 10:26:31 +0200 Subject: [PATCH] ci: require test job success before auto-merge & cleanup --- .github/workflows/dependabot_pr.yml | 4 ++++ .github/workflows/release.yml | 10 ---------- .github/workflows/tests.yml | 11 +---------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dependabot_pr.yml b/.github/workflows/dependabot_pr.yml index 817dbb3e..089db7b6 100644 --- a/.github/workflows/dependabot_pr.yml +++ b/.github/workflows/dependabot_pr.yml @@ -6,9 +6,13 @@ on: - opened jobs: + tests: + if: ${{ github.actor == 'dependabot[bot]' && github.event.label.name == 'dependencies' }} + uses: ./.github/workflows/tests.yml dependabot: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' && github.event.label.name == 'dependencies' }} + needs: [tests] steps: - name: Dependabot metadata diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06863982..7e4387f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,6 @@ on: tags: - "[0-9]+.[0-9]+.[0-9]+" -env: - HAS_SECRETS: ${{ secrets.HAS_SECRETS }} - jobs: tests: name: Release new Docker Image in GHCR @@ -24,13 +21,6 @@ jobs: with: fetch-depth: 0 - - name: Initialise gopass - uses: camptocamp/initialise-gopass-summon-action@v2 - with: - ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} - github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} - if: env.HAS_SECRETS == 'HAS_SECRETS' - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c659862..12d0f712 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,9 +3,7 @@ name: Python unit tests on: push: pull_request: - -env: - HAS_SECRETS: ${{ secrets.HAS_SECRETS }} + workflow_call: jobs: tests: @@ -23,13 +21,6 @@ jobs: with: fetch-depth: 0 - - name: Initialise gopass - uses: camptocamp/initialise-gopass-summon-action@v2 - with: - ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} - github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} - if: env.HAS_SECRETS == 'HAS_SECRETS' - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: