diff --git a/.github/workflows/template_automerge_dependabot.yml b/.github/workflows/template_automerge_dependabot.yml index e2c1d3e7..37a360ec 100644 --- a/.github/workflows/template_automerge_dependabot.yml +++ b/.github/workflows/template_automerge_dependabot.yml @@ -3,6 +3,11 @@ name: Dependabot Auto-Merge on: workflow_call: + inputs: + force: + default: false + required: false + type: boolean secrets: app_id: required: true @@ -35,7 +40,12 @@ jobs: if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' run: | gh pr review --approve "$PR_URL" - gh pr merge --auto --merge "$PR_URL" + + if [ ${{ inputs.force }} == 'true' ]; then + gh pr merge "$PR_URL" --squash --admin + else + gh pr merge --auto --merge "$PR_URL" + fi env: PR_URL: ${{ github.event.pull_request.html_url }} GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} diff --git a/README.md b/README.md index 77e0a440..8b1ae9c5 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ on: jobs: : - uses: Staffbase/gha-workflows/.github/workflows/template_*.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_*.yml@v3.3.1 with: ... ``` @@ -29,15 +29,24 @@ In this section you can find examples of how to use template workflows. For more The action can be used to auto-merge a dependabot PR with minor and patch updates. The action is called by creating a PR. It is necessary that the repository is enabled for auto-merge. +Afterward the PR will be merged with the help of the merge queue if all required conditions of the repository are fulfilled. + +⚠️ You can also force a merge of a PR. This means that the PR will immediately be merged. +If you want to enable the force merge, make sure that the app can bypass any protection rules. ```yml name: Enable Dependabot Auto-Merge -on: pull_request +on: + pull_request: + types: [opened] jobs: dependabot: - uses: Staffbase/gha-workflows/.github/workflows/template_automerge_dependabot.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_automerge_dependabot.yml@v3.3.1 + with: + # optional: ⚠️ only enable the force merge if you want to do the merge just now + force: true secrets: # identifier of the GitHub App for authentication app_id: ${{ }} @@ -63,7 +72,7 @@ on: jobs: autodev: - uses: Staffbase/gha-workflows/.github/workflows/template_autodev.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_autodev.yml@v3.3.1 with: # optional: base branch from which the history originates, default: main base: master @@ -104,7 +113,7 @@ on: [ push ] jobs: gitops: - uses: Staffbase/gha-workflows/.github/workflows/template_gitops.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_gitops.yml@v3.3.1 with: # optional: list of build-time variables docker-build-args: | @@ -160,7 +169,7 @@ on: jobs: jira_annotate: - uses: Staffbase/gha-workflows/.github/workflows/template_jira_tagging.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_jira_tagging.yml@v3.3.1 with: # optional: name of the service to add as label, default: name of the repository name: 'component name' @@ -192,7 +201,7 @@ on: jobs: ld_code_references: - uses: Staffbase/gha-workflows/.github/workflows/template_launchdarkly_code_references.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_launchdarkly_code_references.yml@v3.3.1 with: # optional: key of the LD project, default: default project-key: 'my-project' @@ -220,7 +229,7 @@ on: jobs: update_release_draft: - uses: Staffbase/gha-workflows/.github/workflows/template_release_drafter.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_release_drafter.yml@v3.3.1 with: # optional: name of the release name: Version X.Y.Z @@ -251,7 +260,7 @@ on: jobs: new_version: - uses: Staffbase/gha-workflows/.github/workflows/template_release_version.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_release_version.yml@v3.3.1 ``` You could use the action in combination with the reusable release drafter. @@ -278,7 +287,7 @@ on: [pull_request] jobs: trufflehog: - uses: Staffbase/gha-workflows/.github/workflows/template_secret_scan.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_secret_scan.yml@v3.3.1 ``` @@ -296,7 +305,7 @@ on: jobs: stale: - uses: Staffbase/gha-workflows/.github/workflows/template_stale.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_stale.yml@v3.3.1 with: # optional: comment on the stale pull request while closed, default: This stale PR was closed because there was no activity. close-pr-message: your message @@ -332,7 +341,7 @@ on: jobs: techdocs: - uses: Staffbase/gha-workflows/.github/workflows/template_techdocs.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_techdocs.yml@v3.3.1 with: # optional: kind of the Backstage entity, default: Component # ref: https://backstage.io/docs/features/software-catalog/descriptor-format#contents @@ -363,7 +372,7 @@ on: jobs: trigger-testio-test: - uses: Staffbase/gha-workflows/.github/workflows/template_testio_trigger_test.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_testio_trigger_test.yml@v3.3.1 with: # optional: the slug you received from TestIO, defaults to 'staffbase' testio-slug: your TestIO slug @@ -395,7 +404,7 @@ on: jobs: yamllint: - uses: Staffbase/gha-workflows/.github/workflows/template_yaml.yml@v3.2.0 + uses: Staffbase/gha-workflows/.github/workflows/template_yaml.yml@v3.3.1 with: # optional: name of the running action, default: yamllint / yamllint action-name: your name