aboutsummaryrefslogtreecommitdiff
path: root/.forgejo/workflows/format.yml
diff options
context:
space:
mode:
authorBradley Taunt <git@btxx.org>2026-05-28 08:43:26 -0400
committerBradley Taunt <git@btxx.org>2026-05-28 08:43:26 -0400
commit06e24421234cfc809720dd75131fb30a8666db91 (patch)
tree52ac350a5d847e433279f1b81944764abff76810 /.forgejo/workflows/format.yml
parent015c2cfd1dbd52a5e699812aee9f2d365733a51d (diff)
Testing out Codeberg runners
Diffstat (limited to '.forgejo/workflows/format.yml')
-rw-r--r--.forgejo/workflows/format.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/.forgejo/workflows/format.yml b/.forgejo/workflows/format.yml
new file mode 100644
index 0000000..0f3d548
--- /dev/null
+++ b/.forgejo/workflows/format.yml
@@ -0,0 +1,30 @@
+name: Format sites
+on:
+ push:
+ branches:
+ - master
+jobs:
+ format-sites:
+ runs-on: codeberg-small
+ container:
+ image: alpine:edge
+ steps:
+ - name: Install packages
+ run: apk add --no-cache yq git openssh
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Skip if last commit is from the bot
+ run: |
+ if git log -1 --pretty=format:'%an' | grep -q "Formatting Bot"; then
+ echo "Last commit by bot, skipping"
+ exit 0
+ fi
+ - name: Format and push
+ run: |
+ git config user.email "bot@1mb.club"
+ git config user.name "Formatting Bot"
+ yq --inplace 'sort_by(.domain)' _data/sites.yml
+ sed -i '1!s/- domain:/\n- domain:/g' _data/sites.yml
+ git diff --quiet || (git commit -am "Fix formatting" && git push) \ No newline at end of file