Handle stale branches #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- 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@v3 | |
- 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" |