From 3673463f9ece8c84a7d88e86dd389233782a0f76 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Wed, 6 Apr 2022 23:26:02 +0200 Subject: [PATCH] ci: split Automerge and convert Doc to a reusable workflow Signed-off-by: Unai Martinez-Corral --- .github/workflows/Automerge.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/Doc.yml | 22 +--------------------- 2 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/Automerge.yml diff --git a/.github/workflows/Automerge.yml b/.github/workflows/Automerge.yml new file mode 100644 index 0000000..28b8647 --- /dev/null +++ b/.github/workflows/Automerge.yml @@ -0,0 +1,29 @@ +name: Automerge + +on: + pull_request: + push: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + + + Pipeline: + if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }} + uses: ./.github/workflows/Doc.yml + + + Automerge: + needs: Pipeline + if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + name: Automerge dependabot PRs + permissions: + contents: write + + steps: + + - name: Auto-merge Dependabot PR + run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash diff --git a/.github/workflows/Doc.yml b/.github/workflows/Doc.yml index 210f9a0..67aefe6 100644 --- a/.github/workflows/Doc.yml +++ b/.github/workflows/Doc.yml @@ -1,17 +1,11 @@ name: Docs on: - pull_request: - push: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: + workflow_call: jobs: - Docs: - if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }} runs-on: ubuntu-latest name: '📓 Docs' steps: @@ -50,17 +44,3 @@ jobs: git config --local user.name "GitHub Actions" git commit -a -m "update ${{ github.sha }}" git push -u origin +HEAD:gh-pages - - - Automerge: - needs: Docs - if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' - runs-on: ubuntu-latest - name: Automerge dependabot PRs - permissions: - contents: write - - steps: - - - name: Auto-merge Dependabot PR - run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash