Skip to content

Periodic update of MAINTAINERS.md #81

Periodic update of MAINTAINERS.md

Periodic update of MAINTAINERS.md #81

# SPDX-License-Identifier: Apache-2.0
name: Periodic update of MAINTAINERS.md
on:
schedule:
- cron: '0 0 * * *' # Runs every day at 00:00 UTC
workflow_dispatch: # Allow manual trigger
env:
LC_ALL: en_US.UTF-8
defaults:
run:
shell: bash
jobs:
update-maintainers:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: "Harden Runner"
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: "Checkout"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Setup Python"
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.11"
- name: "Install Python Packages"
run: |
pip install -r tools/maintainers/requirements.txt
- name: Update maintainers page
run: |
tools/maintainers/maintainers.py tools/maintainers/teams.yaml > MAINTAINERS.md
env:
GH_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
- name: Check for changes
id: git-diff
run: |
echo "changed=$(git diff --quiet --exit-code -- MAINTAINERS.md; echo "$?")" >> "$GITHUB_OUTPUT"
- name: Create Pull Request
if: steps.git-diff.outputs.changed == '1'
run: |
git config --global user.name 'Maintainers Update Bot'
git config --global user.email 'ci@instructlab.ai'
git checkout -b maintainers-update
git add -- MAINTAINERS.md
git commit -s -m "MAINTAINERS.md: automated update"
git push -u -f origin maintainers-update
if ! (gh pr list --head maintainers-update --json number | grep -q "number") ; then
gh pr create --title "MAINTAINERS.md: automated update" --body "Automated update of MAINTAINERS.md"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}