armbian-build/.github/workflows/sync-maintainers-status.yml
Igor Pecovnik f56bfc7553
chore: rename workflow files to action-oriented naming
Rename all workflow files to follow a consistent action-oriented naming pattern similar to armbian.github.io:

- adjust-maintainers.yml → sync-maintainers-status.yml
- clean-workflow-logs.yml → cleanup-workflow-logs.yml
- forked-helper.yml → help-forked.yml
- issue-welcome-first-time.yml → welcome-issue-first-time.yml
- labels-from-yml.yml → sync-labels.yml
- merge-announce.yml → announce-merge.yml
- open-jira-ticket.yml → create-jira-ticket.yml
- pr-announce.yml → announce-pr.yml
- pr-auto-labeler.yml → auto-label-pr.yml
- pr-build-artifacts.yml → build-pr-artifacts.yml
- pr-check-pictures.yml → check-pr-pictures.yml
- pr-kernel-security-analysis.yml → analyze-pr-kernel-security.yml
- pr-label-on-approved.yml → label-pr-on-approval.yml
- pr-lint-scripts.yml → lint-pr-scripts.yml
- pr-review-listener.yml → listen-pr-review.yml
- pr-welcome-first-time.yml → welcome-pr-first-time.yml
- rewrite-kernel-configs.yml → rewrite-kernel-config-files.yml
- update-board-list.yml → sync-board-list.yml
- update-tools.yml → sync-tools.yml

This makes the workflow names more descriptive and consistent with the action verb first, followed by the target object.
2025-12-25 11:43:57 +01:00

122 lines
4.2 KiB
YAML

name: "Sync maintainers status"
# Script connects to the contacts database once per hour and updates BOARD_MAINTAINER property in the board config files.
# If there are any changes, it opens a Pull Request
#
# spdx-id: GPL-2.0-or-later
# copyright-owner: @igorpecovnik
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
Build:
name: "Maintainers sync"
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'armbian' }}
steps:
- name: "Checkout build repo"
uses: actions/checkout@v6
with:
repository: armbian/build
ref: main
fetch-depth: 0
clean: false
- name: "Install SSH key for storage"
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KEY_UPLOAD }}
known_hosts: ${{ secrets.KNOWN_HOSTS_ARMBIAN_UPLOAD }}
if_key_exists: replace
- name: "Download JSON file"
run: |
# download json that is prepared in https://github.com/armbian/armbian.github.io
curl -o /tmp/armbian_maintainers.json https://github.armbian.com/maintainers.json
- name: "Update maintainers"
run: |
# reset all maintainers so we generate from scratch
sed -i "s/BOARD_MAINTAINER.*/BOARD_MAINTAINER=\"\"/" config/boards/*.{conf,wip,eos,tvb}
# extract values fron JSON
declare -A MAINTAINERS
{
# By default, bash run the pipe command in subshells
# which make variable can't be assigned to.
# And yes, lastpipe can solve it
# But this is better.
while read -r i; do
NAME="$(echo "$i" | jq --raw-output '.First_Name')"
BOARD="$(echo "$i" | jq --raw-output '.Maintaining')"
MAINTAINER_GITHUB="$(echo "$i" | jq --raw-output '.Github' | cut -d"/" -f4)"
if [[ "$BOARD" != null && "$MAINTAINER_GITHUB" != null ]]; then
echo "- [$NAME](https://github.com/${MAINTAINER_GITHUB})"
while read -r i; do
echo -e " - $i"
MAINTAINERS["$i"]+="$MAINTAINER_GITHUB "
done < <( echo "$BOARD" | sed "s/,/\n/g" | sort -u )
fi
done < <(jq -c '.[]' /tmp/armbian_maintainers.json)
for cfg in config/boards/*.{conf,wip,csc,eos,tvb}; do
board_name="$(echo "${cfg##*/}" | sed -E 's/\..*//')"
declare -a maintainers
readarray -t maintainers < <(echo "${MAINTAINERS[${board_name}]}" | xargs -n1 | sort -u)
sed -i "s/BOARD_MAINTAINER=.*/BOARD_MAINTAINER=\"${maintainers[*]}\"/" "${cfg}"
done
} >> "$GITHUB_STEP_SUMMARY"
- name: "Mark csc for no maintainer"
run: |
grep BOARD_MAINTAINER=\"\" config/boards/*.{wip,conf} | cut -d":" -f1 |
while read -r line; do
if [[ "${line}" != "${line/.conf/.csc}" ]]; then
mv -v "$line" "${line/.conf/.csc}"
fi
if [[ "${line}" != "${line/.wip/.csc}" ]]; then
mv -v "$line" "${line/.wip/.csc}"
fi
done
- name: "Re-generate CODEOWNERS"
run: |
./.github/generate_CODEOWNERS.sh
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: '`Automatic` board configs status synchronise'
signoff: false
branch: update-maintainers
delete-branch: true
title: '`Automatic` board configs status synchronise'
body: |
Update maintainers and board status
- synced status from the database
- rename to .`csc` where we don't have anyone
If you want to become a board maintainer, [adjust data here](https://www.armbian.com/update-data/).
Ref:
- [Board Maintainers Procedures and Guidelines](https://docs.armbian.com/Board_Maintainers_Procedures_and_Guidelines/)
- [Contribute](https://docs.armbian.com/Process_Contribute/)
labels: |
Work in progress
#assignees: igorpecovnik
#reviewers: Must be org collaborator
draft: false