forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.75 KB
/
handle-stale-branches.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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"