Skip to content
/ cull Public
generated from actions/typescript-action

Delete abandoned branches automatically. Stay clean.

License

Notifications You must be signed in to change notification settings

game8inc/cull

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

typescript-action status

Cull

Everyday, let Github Actions delete your branches such as:

  • no recent commits
  • no related pull requests
  • non-protected branch

Stay clean and Happy coding 👍

Usage

name: Auto-delete abandoned branches every morning.

on:
  schedule:
    - cron: "30 1 * * *"

permissions:
  contents: write

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: game8inc/cull@v1
      with:
        repo-token: ${{ secrets.YOUR_GITHUB_TOKEN }}
        dry-run: 'true'
        older-than: '10'
        max-deletion-per-day: '5'

Contribution

  1. .node-versionに合わせてnodeをインストール(例:nodenvの場合)

    nodenv install $(cat .node-version) && nodenv local $(cat .node-version)

  2. .envrc.exampleをコピーして.envrcを作成。自分のfine-grained Personal Access Tokenを生成して、LOCAL_GITHUB_TOKENをセットする

  3. 以下のコマンドでローカルで実行できることを確認する

    npx ts-node src/run.ts
  4. 以下のコマンドでローカルでテストがパスするまで確認

    npm install
    npm run build
    npm run package
    npm test