Skip to content

Delete Inactive Users in Github Organization #35

Delete Inactive Users in Github Organization

Delete Inactive Users in Github Organization #35

name: 'Delete Inactive Users in Github Organization'
on:
schedule:
- cron: '0 0 */32,1-7 * 1'
workflow_dispatch:
push:
branches:
- "add-inactive-user-removal-automation"
jobs:
org-config-generation-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
path: community
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "community/orgs/pyproject.toml"
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Clean inactive github org users
id: uds
working-directory: ./community/orgs
run: |
uv run --no-dev python -m org_management.org_user_management
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
INACTIVE_USER_MANAGEMENT_TAG_USERS: ${{ secrets.INACTIVE_USER_MANAGEMENT_TAG_USERS }}
- name: Create Pull Request
if: ${{ steps.uds.outputs.inactive_users_pr_description }}
uses: peter-evans/create-pull-request@v5
with:
path: community
add-paths: orgs/contributors.yml
commit-message: Delete inactive users
branch: delete-inactive-users
title: 'Inactive users to be deleted'
body: ${{ steps.uds.outputs.inactive_users_pr_description }}