Skip to content

How to Automatically Increment Project Version When Dependabot Creates PR for Dependency Updates? #149185

Discussion options

You must be logged in to vote

Create a version-bump.yml with

name: Version Bump on Dependabot PR

on:
  pull_request:
    types: [opened, reopened, synchronized]
    branches:
      - main  # or your default branch

jobs:
  version-bump:
    if: github.actor == 'dependabot[bot]'
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write

    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.ref }}
          fetch-depth: 0

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '18'

      - name: Configure Git
        run: |
          git config user.name 'github-actions[bot]'
       …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TenEplaysOfficial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General General topics and discussions that don't fit into other categories, but are related to GitHub Question Ask and answer questions about GitHub features and usage
2 participants