zenoh
zenoh copied to clipboard
Automatic Generation of License Headers
At first, I've tried with skywalking-eyes developed by Apache. But it turns out to be too slow to generate the header. Then hawkeye from the greptime was tested and ran fluently. It's quite slim and extensible to use. And the check is fast enough to be integrated into CI.
An example workflow to automatize the license header fix.
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# To work with PR.
# See https://github.com/EndBug/add-and-commit?tab=readme-ov-file#working-with-prs
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Check License Header
uses: korandoru/hawkeye@v5
with:
mode: format
# Workaround: hawkeye uses the inappropriate logging level.
continue-on-error: true
- uses: EndBug/add-and-commit@v9
with:
committer_name: eclipse-zenoh-bot
committer_email: [email protected]
A manual check is still needed as the feature of publication year is still missing. See https://github.com/korandoru/hawkeye/issues/114
I think the workflow should be added to eclipse-zenoh/ci
instead of eclipse-zenoh/zenoh
. @fuzzypixelz ?
@diogomatsubara could please have a look at this PR?
@Mallets sure thing. I'll add the workflow to the CI repository and then enable them for the zenoh-*
repos.