From 975aec07914707e36b84cceb1883d370aaf067be Mon Sep 17 00:00:00 2001
From: Flo <max06.net@outlook.com>
Date: Mon, 23 Jan 2023 23:08:41 +0100
Subject: [PATCH] ci: Add workflow for updating jekyll-anchor-headings
 automatically (#1075)

---
 .../update_jekyll-anchor-heading.yml          | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 .github/workflows/update_jekyll-anchor-heading.yml

diff --git a/.github/workflows/update_jekyll-anchor-heading.yml b/.github/workflows/update_jekyll-anchor-heading.yml
new file mode 100644
index 00000000..4206ee22
--- /dev/null
+++ b/.github/workflows/update_jekyll-anchor-heading.yml
@@ -0,0 +1,43 @@
+name: Update Vendor plugin - jekyll-anchor-headings
+on:
+  # schedule:
+  #   # once per week
+  #   - cron: "0 15 * * 0"
+  workflow_dispatch:
+jobs:
+  update-deps:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Get latest release information
+        id: latest-release
+        uses: pozetroninc/github-action-get-latest-release@master
+        with:
+          owner: allejo
+          repo: jekyll-anchor-headings
+          excludes: prerelease, draft
+
+      - name: Update jekyll-anchor-headings
+        id: update
+        uses: suisei-cn/actions-download-file@v1.3.0
+        with:
+          url: "https://github.com/allejo/jekyll-anchor-headings/releases/download/${{ steps.latest-release.outputs.release }}/anchor_headings.html"
+          target: _includes/vendor/
+
+      - name: Create PR
+        uses: peter-evans/create-pull-request@v4
+        with:
+          commit-message: "chore[dependency]: Update `jekyll-anchor-headings` to `${{ steps.latest-release.outputs.release }}`"
+          title: "auto: Update `jekyll-anchor-headings` to `${{ steps.latest-release.outputs.release }}`"
+          body: |
+            Update `jekyll-anchor-headings` to `${{ steps.latest-release.outputs.release }}`
+            This is an automated pull request.
+          branch: update/vendor/jekyll-anchor-headings
+          delete-branch: true
+          labels: |
+            kind/update
+            area/dependency
+          add-paths: |
+            _includes/vendor/anchor_headings.html
+          token: ${{ secrets.GITHUB_TOKEN }}
-- 
GitLab