Skip to content

Handle stale branches #78

Handle stale branches

Handle stale branches #78

name: Handle stale branches
on:
schedule:
# runs every day at midnight (UTC time).
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
handle_contributor_stale_branches:
runs-on: ubuntu-latest
if: github.repository == 'demisto/content'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install Python Dependencies
run: |
poetry install --with ci
- name: Delete Stale Contributor Branches
env:
CONTENTBOT_GH_ADMIN_TOKEN: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }}
run: |
echo "Deleting stale contribution base branches (contrib/*)"
cd Utils/github_workflow_scripts
poetry run ./delete_stale_contrib_branches.py
echo "Finished deleting stale branches"
handle_stale_non_contributor_branches:
runs-on: ubuntu-latest
if: github.repository == 'demisto/content'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Setup Poetry
uses: Gr1N/setup-poetry@v8
- name: Install Python Dependencies
run: |
poetry install --with ci
- name: Delete Stale Non Contributor Branches
env:
CONTENTBOT_GH_ADMIN_TOKEN: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }}
run: |
echo "Deleting stale non contribution branches"
cd Utils/github_workflow_scripts
poetry run ./delete_stale_non_contrib_branches.py
echo "Finished deleting stale branches"