Skip to content
upload-cloud

GitHub Action

Renovate Automatic Branch

v1.0.13 Latest version

Renovate Automatic Branch

upload-cloud

Renovate Automatic Branch

Automatically create an empty branch to merge Renovate PR

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Renovate Automatic Branch

uses: bodinsamuel/[email protected]

Learn more about this action in bodinsamuel/renovate-automatic-branch

Choose a version

renovate-automatic-branch

Create automatic branch to merge Renovate PRs.

Prerequisites

Configure your renovate with:

{
  "baseBranches": [
    "chore/renovateBaseBranch"
  ],
}

Usage

Github Action

# With Github Action
jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Renovate Automatic Branch
        uses: bodinsamuel/renovate-automatic-branch@v1
        with:
          github-token: YOUR_GITHUB_TOKEN
          repo-owner: YOUR_ORG
          repo-name: YOUR_REPO
# With Docker image
jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Test
        run: |
          docker run --rm -i \
            -e RAB_GH_TOKEN='${{ secrets.PERSONAL_GITHUB_TOKEN }}' \
            -e RAB_OWNER='${{ github.repository_owner }}' \
            -e RAB_REPO='renovate-automatic-branch' \
            ghcr.io/bodinsamuel/renovate-automatic-branch:latest
# To automate
name: Renovate
on:
  schedule:
    - cron: '0 14 * * 5' # e.g: Every friday afternoon

Optional parameters

You can customize the behavior of the action by providing the following parameters:

parameter description default value
branch-to-create The name of the branch that will be created chore/renovateBaseBranch
branch-base The name of the branch that will be used as base main
empty-commit-msg The commit msg that will be created by the script chore: automatic empty commit
pull-request-title The title of the pull request opened by the action fix: dependencies
pull-request-body The body (description) of the pull request opened by the action Weekly dependencies update.

Docker image

docker run --rm -i \
  -e RAB_GH_TOKEN='${{ secrets.PERSONAL_GITHUB_TOKEN }}' \
  -e RAB_OWNER='${{ github.repository_owner }}' \
  -e RAB_REPO='renovate-automatic-branch' \
  ghcr.io/bodinsamuel/renovate-automatic-branch:latest

Available environment variables: constants.ts

Programmatic

npm install -ED renovate-automatic-branch
import { run } from 'renovate-automatic-branch/run';

run({
  ghToken: process.env.TOKEN,
  // [...]
})