From b80cbc0ee09eda65104a51989189e8b0ed581ab3 Mon Sep 17 00:00:00 2001 From: Luquinhas Date: Fri, 11 Apr 2025 11:33:04 -0300 Subject: [PATCH] Add workflow to update AUTHORS file at every commit --- .github/workflows/update-authors.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/update-authors.yml diff --git a/.github/workflows/update-authors.yml b/.github/workflows/update-authors.yml new file mode 100644 index 0000000..79e8f27 --- /dev/null +++ b/.github/workflows/update-authors.yml @@ -0,0 +1,36 @@ +name: Update AUTHORS File + +on: + push: + branches: + - main + +jobs: + update-authors: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Git config + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Generate AUTHORS file (Name format) + run: | + git log --format='%aN <%aE>' | sort -u > AUTHORS + + - name: Check if AUTHORS file changed + run: | + if git diff --quiet AUTHORS; then + echo "No changes in AUTHORS file." + exit 0 + fi + + - name: Commit and push changes + run: | + git add AUTHORS + git commit -m "Update AUTHORS file automatically" + git push