build(deps): Bump github/codeql-action from 3.28.6 to 3.28.8 in the minor-and-patch group across 1 directory #471
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dependabot Pull Request Approve and Merge | |
on: | |
pull_request: | |
# Default types + 'auto_merge_disabled'. | |
# This allows Dependabot PRs to be automatically merged even if the target branch is updated after auto-merge has been enabled. | |
types: [opened, synchronize, reopened, auto_merge_disabled] | |
jobs: | |
dependabot: | |
runs-on: ubuntu-latest | |
# Makes sure it's a dependabot PR. | |
if: ${{ github.actor == 'dependabot[bot]' }} | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Dependabot metadata | |
id: dependabot-metadata | |
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Echo previous version' | |
run: echo "$PREV_VERSION" | |
env: | |
PREV_VERSION: ${{ steps.dependabot-metadata.outputs.previous-version }} | |
# Only auto-approve minor and patch versions. | |
- name: Approve PR | |
if: | | |
steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' | |
&& !startsWith(steps.dependabot-metadata.outputs.previous-version, '0') | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GITHUB_TOKEN: ${{ secrets.PAT_PR_READ_WRITE }} | |
# Only enable auto-merge for minor and patch versions. | |
- name: Enable auto-merge for Dependabot PRs | |
if: | | |
steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' | |
&& !startsWith(steps.dependabot-metadata.outputs.previous-version, '0') | |
run: gh pr merge --auto --squash "$PR_URL" | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GITHUB_TOKEN: ${{ secrets.PAT_PR_READ_WRITE }} |