Skip to content

Commit 0e75a5e

Browse files
committed
adding workflow files
1 parent c04e720 commit 0e75a5e

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.github/auto-sync/PR_BODY.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This PR was generated automatically by a scheduled workflow.
2+
3+
It includes updates from `configlet sync` for:
4+
- 📄 Documentation
5+
- 🧭 Metadata
6+
- 🗂️ Filepaths
7+
8+
Please review and merge if everything looks good!

.github/auto-sync/sync-test-output.txt

Whitespace-only changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Configlet Auto Sync
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 1,15 * *'
7+
8+
jobs:
9+
configlet-auto-sync:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Fetch configlet
17+
run: ./bin/fetch-configlet
18+
19+
- name: Run configlet sync for files
20+
run: ./bin/configlet sync --docs --metadata --filepaths -u -y
21+
22+
- name: Create pull request if changes
23+
uses: peter-evans/create-pull-request@v5
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
commit-message: "🤖 Auto-sync docs, metadata, and filepaths"
27+
title: "🤖 Configlet sync: docs, metadata, and filepaths"
28+
body-path: .github/auto-sync/PR_BODY.md
29+
branch: configlet-auto-sync
30+
delete-branch: true
31+
32+
- name: Run configlet sync for test and capture output
33+
id: sync_test
34+
run: |
35+
./bin/configlet sync --test | tee .github/auto-sync/sync-test-output.txt
36+
echo "output<<EOF" >> $GITHUB_OUTPUT
37+
cat .github/auto-sync/sync-test-output.txt >> $GITHUB_OUTPUT
38+
echo "EOF" >> $GITHUB_OUTPUT
39+
40+
- name: Create issue if tests are not synced
41+
if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }}
42+
uses: peter-evans/create-issue-from-file@v4
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
title: "🚨 configlet sync --test found unsynced tests"
46+
content-filepath: .github/auto-sync/sync-test-output.txt

0 commit comments

Comments
 (0)