Skip to content

Update github/codeql-action action to v2.22.11 #487

Update github/codeql-action action to v2.22.11

Update github/codeql-action action to v2.22.11 #487

name: Auto approve and merge PRs by dependabot
# Trigger the workflow on pull request
on: pull_request
permissions:
pull-requests: write
contents: write
jobs:
auto-approve:
name: Automatically approve dependabot PRs
runs-on: ubuntu-latest
env:
is_bot1: ${{ github.actor == 'dependabot[bot]' }}
is_bot2: ${{ github.actor == 'dependabot-preview[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
with:
skip-verification: true
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' }}
continue-on-error: true
- name: Auto approve patch and minor
env:
is_patch: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
is_minor: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
if: ${{ (env.is_patch || env.is_minor) && (env.is_bot1 || env.is_bot2) }}
uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1
# Perform the auto-approve action only when the PR is raised by dependabot and is a minor or patch
with:
# Create a personal access token and store it under the Secrets section of the particular repository
# with the key "DEPENDABOT_ACTIONS_TOKEN"
github-token: ${{ secrets.DEPENDABOT_ACTIONS_SECRET }}
continue-on-error: true
- name: Auto merge
uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 # v0.15.6
# Perform the auto-merge action only when the PR is raised by dependabot for patch or minor
if: ${{ (env.is_patch || env.is_minor) && (env.is_bot1 || env.is_bot2) }}
env:
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_ACTIONS_SECRET }}
# Whenever dependabot raises a PR, it automatically assigns a label named "dependencies"
# Merges those PRs labelled "dependencies" only
MERGE_LABELS: dependencies
MERGE_METHOD: rebase
continue-on-error: true