ybbond

My site. The main domain
Log | Files | Refs | README | LICENSE | CC-LICENSE

commit 7a68bcf8fcdad76d77857be32f80d1b306e7a7e0
parent be4238d90d07a58b676f51c848276bcb0ae4bdd1
Author: Yohanes Bandung <hi@ybbond.dev>
Date:   Thu,  4 Jun 2020 00:24:22 +0700

feature: github actions for webmentions

Diffstat:
A.github/workflows/webmentions.yml | 36++++++++++++++++++++++++++++++++++++
Rwebmention.js -> webmentions.js | 0

2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/webmentions.yml b/.github/workflows/webmentions.yml
@@ -0,0 +1,36 @@
+name: Webmentions
+
+on:
+  schedule:
+    - cron: "0 */6 * * *"
+
+jobs:
+  webmentions:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check out repository
+        uses: actions/checkout@master
+
+      - name: Set up Node.js
+        uses: actions/setup-node@master
+        with:
+          node-version: 12.x
+
+      - name: Fetch webmentions
+        env:
+          WEBMENTIONS_TOKEN: ${{ secrets.WEBMENTIONS_TOKEN }}
+        run: node ./webmentions.js
+
+      - name: Commit to repository
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          COMMIT_MSG: |
+            Fetch webmentions
+            skip-checks: true
+        run: |
+          git config user.email "hi@ybbond.dev"
+          git config user.name "Yohanes Bandung Bondowoso"
+          git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/ybbond/ybbond.git
+          git checkout master
+          git add .
+          git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin master)
diff --git a/webmention.js b/webmentions.js