Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0e75a5e
adding workflow files
jagdish-15 Jun 5, 2025
8d03422
Update .github/workflows/configlet-sync.yml
jagdish-15 Jun 5, 2025
0f84382
Update configlet-sync.yml to fix the command for tests
jagdish-15 Jun 7, 2025
853188c
Merge branch 'main' into add-sync-workflow
jagdish-15 Jun 7, 2025
4bc9381
Update configlet-sync.yml to ensure no duplicate issues are opened
jagdish-15 Jun 7, 2025
10a2a27
Merge pull request #2 from jagdish-15/add-sync-workflow
jagdish-15 Jun 8, 2025
14e89a1
Refactoring yml workflow for tests
jagdish-15 Jun 8, 2025
0cf40a5
Merge pull request #3 from jagdish-15/add-sync-workflow
jagdish-15 Jun 8, 2025
7730a50
Removing line causing error
jagdish-15 Jun 8, 2025
ab56210
Merge branch 'main' into add-sync-workflow
jagdish-15 Jun 8, 2025
527450f
Updating sync test
jagdish-15 Jun 8, 2025
f8dc41e
Merge branch 'add-sync-workflow' of https://github.com/jagdish-15/jav…
jagdish-15 Jun 8, 2025
6cbcf91
Updating sync test
jagdish-15 Jun 8, 2025
4491143
Updating workflow file to print body od the issue
jagdish-15 Jun 8, 2025
1f942d8
Adding GitHub API integration to ensure no duplicate issues are opened
jagdish-15 Jun 8, 2025
5a8b785
Adding backticks in issue content
jagdish-15 Jun 8, 2025
84f2619
Removing unnecesarry mkdir command
jagdish-15 Jun 8, 2025
82da5d0
Adding tests command
jagdish-15 Jun 8, 2025
b76a630
variable name mismatch
jagdish-15 Jun 8, 2025
231b7e8
Merge branch 'main' into add-sync-workflow
jagdish-15 Jun 9, 2025
81c27ee
Merge branch 'main' into add-sync-workflow
jagdish-15 Jun 13, 2025
ab090e7
Refactoring workflow into two different jobs and adding option to not…
jagdish-15 Jun 13, 2025
17754a0
removing env toggle for second job
jagdish-15 Jun 14, 2025
8f050cf
Removing dependency by replacing body-path by body
jagdish-15 Jun 14, 2025
d7f6607
Removing dependency by removing auto-sync dir and its usage
jagdish-15 Jun 14, 2025
4e7efff
Removing needs statement
jagdish-15 Jun 14, 2025
d1f3dec
Adding timeout (best GHA practice documentation)
jagdish-15 Jun 16, 2025
02435d1
Reducing timeout minutes
jagdish-15 Jun 16, 2025
dc8e4eb
Pinning test runner version (best GHA practice documentation)
jagdish-15 Jun 16, 2025
1714d68
Merge branch 'main' into add-sync-workflow
jagdish-15 Jun 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/auto-sync/PR_BODY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This PR was generated automatically by a scheduled workflow.

It includes updates from `configlet sync` for:
- 📄 Documentation
- 🧭 Metadata
- 🗂️ Filepaths

Please review and merge if everything looks good!
Empty file.
46 changes: 46 additions & 0 deletions .github/workflows/configlet-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Configlet Auto Sync

on:
workflow_dispatch:
schedule:
- cron: '0 0 15 * *'

jobs:
configlet-auto-sync:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Fetch configlet
run: ./bin/fetch-configlet

- name: Run configlet sync for files
run: ./bin/configlet sync --docs --metadata --filepaths -u -y

- name: Create pull request if changes
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "🤖 Auto-sync docs, metadata, and filepaths"
title: "🤖 Configlet sync: docs, metadata, and filepaths"
body-path: .github/auto-sync/PR_BODY.md
branch: configlet-auto-sync
delete-branch: true

- name: Run configlet sync for test and capture output
id: sync_test
run: |
./bin/configlet sync --test | tee .github/auto-sync/sync-test-output.txt
Copy link
Member

@kahgoh kahgoh Jun 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing, I just noticed this in the logs:

Run ./bin/configlet sync --test | tee .github/auto-sync/sync-test-output.txt
  ./bin/configlet sync --test | tee .github/auto-sync/sync-test-output.txt
  echo "output<<EOF" >> $GITHUB_OUTPUT
  cat .github/auto-sync/sync-test-output.txt >> $GITHUB_OUTPUT
  echo "EOF" >> $GITHUB_OUTPUT
  shell: /usr/bin/bash -e {0}
  env:
    PULL_REQUEST_NUMBER: 1
Error: invalid option: '--test'

I think it should be --tests (plural, not the singular --test), but we also need to choose an option between include and exclude (see configlet --help or its documentation for more details).

Copy link
Member Author

@jagdish-15 jagdish-15 Jun 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that should be --tests, apologies for the mix-up. And I it by default checks all the exercises with configlet sync --tests, so we don't need to use include as we only have to get the info about unsynced tests and not actually update the test.toml files

echo "output<<EOF" >> $GITHUB_OUTPUT
cat .github/auto-sync/sync-test-output.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create issue if tests are not synced
if: ${{ !contains(steps.sync_test.outputs.output, 'Every exercise has up-to-date tests!') }}
uses: peter-evans/create-issue-from-file@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "🚨 configlet sync --test found unsynced tests"
content-filepath: .github/auto-sync/sync-test-output.txt
Loading