Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

add locale-action.yml

daniel31x138a838f382a55
diff --git a/.github/workflows/locale-action.yml b/.github/workflows/locale-action.yml
new file mode 100644
index 00000000..2e05db0c
--- /dev/null
+++ b/.github/workflows/locale-action.yml
@@ -0,0 +1,54 @@
+name: Manage i18n pull requests
+
+on:
+ pull_request:
+ types: [opened, reopened, synchronize, ready_for_review]
+
+permissions:
+ contents: write
+ pull-requests: write
+
+jobs:
+ rewrite-author:
+ if: github.event.pull_request.head.ref == 'i18n'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout full history of the i18n branch
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.ref }}
+ fetch-depth: 0
+
+ - name: Give up early if the latest commit is already from LinkwardenBot
+ run: |
+ if [ "$(git show -s --format='%an')" = 'LinkwardenBot' ]; then
+ echo "Already rewritten – skipping."
+ exit 0
+ fi
+
+ - name: Set bot identity in local Git config
+ run: |
+ git config user.name "LinkwardenBot"
+ git config user.email "[email protected]"
+
+ - name: Install git-filter-repo (safer & faster than filter-branch)
+ run: |
+ pip install --quiet git-filter-repo
+
+ - name: Rewrite every commit’s author/committer
+ env:
+ NEW_NAME: "LinkwardenBot"
+ NEW_EMAIL: "[email protected]"
+ run: |
+ git filter-repo \
+ --name-callback 'return b"${NEW_NAME}"' \
+ --email-callback 'return b"${NEW_EMAIL}"' \
+ --commit-callback '
+ commit.committer_name = b"${NEW_NAME}"
+ commit.committer_email = b"${NEW_EMAIL}"
+ '
+
+ - name: Force-push the rewritten branch back to GitHub
+ run: |
+ git push --force-with-lease origin HEAD:${{ github.event.pull_request.head.ref }}
\ No newline at end of file