Skip to content

Unsupervisedcom/action-branch-protection-bot

Repository files navigation

GitHub Action:Branch Protection Bot

An action to modify branch protection settings

- uses: Unsupervisedcom/action-branch-protection-bot@undefined
  with:
    # Github token to use
    token: ""

    # Boolean, if true the action will set `include admins` on the branch protection
    # rule
    # Default: true
    set-include-admins: ""

    # Boolean, if true the action will set `include admins` to true on the branch
    # protection rule, else it will set `include admins` to false
    # Default: false
    include-admins: ""

    # Repo owner
    # Default: ${{ github.repository_owner }}
    owner: ""

    # Github repo name
    # Default: ${{ github.event.repository.name }}
    repo: ""

    # Branch change branch protection rules for
    # Default: ${{ github.ref }}
    branch: ""
Input Description Default Required
token Github token to use true
set-include-admins Boolean, if true the action will set include admins on the branch protection rule true false
include-admins Boolean, if true the action will set include admins to true on the branch protection rule, else it will set include admins to false false
owner Repo owner ${{ github.repository_owner }} false
repo Github repo name ${{ github.event.repository.name }} false
branch Branch change branch protection rules for ${{ github.ref }} false
Output Description Default Required
time The time we greeted you

Example usage

on: [push]

jobs:
  hello_world_job:
    runs-on: ubuntu-latest
    name: A job to say hello
    steps:
      - name: Hello world action step
        id: hello
        uses: Unsupervisedcom/action-branch-protection-bot@v1
        with:
          who-to-greet: "Mona the Octocat"
      # Use the output from the `hello` step
      - name: Get the output time
        run: echo "The time was ${{ steps.hello.outputs.time }}"