From 217d55811b1bf43d086420c4de496405a9c73814 Mon Sep 17 00:00:00 2001 From: Ramachandra Avuthu Date: Thu, 22 Jan 2026 13:24:41 -0500 Subject: [PATCH 1/4] workflow - Cronjob that runs everyday at 6AM UTC to check for any updates from adobe/aem-boilerplate Repository and create a PR to Sync those --- .github/workflows/sync-aem-boilerplate.yaml | 54 +++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/sync-aem-boilerplate.yaml diff --git a/.github/workflows/sync-aem-boilerplate.yaml b/.github/workflows/sync-aem-boilerplate.yaml new file mode 100644 index 00000000..9738b110 --- /dev/null +++ b/.github/workflows/sync-aem-boilerplate.yaml @@ -0,0 +1,54 @@ +name: Sync from AEM Boilerplate + +on: + schedule: + # Run daily at 6:00 AM UTC + - cron: '0 6 * * *' + workflow_dispatch: # Allow manual trigger + +jobs: + sync-aem-boilerplate: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download latest AEM Boilerplate from source + run: | + curl -sSL \ + -H "Accept: application/vnd.github.v3.raw" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://raw.githubusercontent.com/adobe/aem-boilerplate/main/scripts/aem.js" \ + -o scripts/aem.js + + - name: Check for changes + id: changes + run: | + if git diff --quiet scripts/aem.js; then + echo "changed=false" >> $GITHUB_OUTPUT + echo "✅ Already up to date" + else + echo "changed=true" >> $GITHUB_OUTPUT + echo "🔄 Changes detected" + fi + + - name: Create Pull Request + if: steps.changes.outputs.changed == 'true' + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "chore: sync AEM Boilerplate from adobe/aem-boilerplate" + title: "🔄 Sync AEM Boilerplate from adobe/aem-boilerplate" + body: | + This PR automatically syncs the files as configured in the `sync-aem-boilerplate.yml` workflow file from the upstream [adobe/aem-boilerplate](https://github.com/adobe/aem-boilerplate) repository. + + --- + _This PR was created automatically by a scheduled sync workflow._ + branch: chore/sync-aem-boilerplate + delete-branch: true + labels: | + automated + sync \ No newline at end of file From 9167639cde3a4c34d7796631226e6316ab0a6f10 Mon Sep 17 00:00:00 2001 From: Ramachandra Avuthu Date: Thu, 22 Jan 2026 13:29:52 -0500 Subject: [PATCH 2/4] added branch name to check against for updates --- .github/workflows/sync-aem-boilerplate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-aem-boilerplate.yaml b/.github/workflows/sync-aem-boilerplate.yaml index 9738b110..c7495a17 100644 --- a/.github/workflows/sync-aem-boilerplate.yaml +++ b/.github/workflows/sync-aem-boilerplate.yaml @@ -22,7 +22,7 @@ jobs: curl -sSL \ -H "Accept: application/vnd.github.v3.raw" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://raw.githubusercontent.com/adobe/aem-boilerplate/main/scripts/aem.js" \ + "https://raw.githubusercontent.com/adobe/aem-boilerplate/main/scripts/aem.js?ref=main" \ -o scripts/aem.js - name: Check for changes From 66faa168250c558704048502064db2e126d5f362 Mon Sep 17 00:00:00 2001 From: Ramachandra Avuthu Date: Thu, 22 Jan 2026 13:44:26 -0500 Subject: [PATCH 3/4] Sync files can be configured now under SYNC_FILES --- .github/workflows/sync-aem-boilerplate.yaml | 55 ++++++++++++++++----- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sync-aem-boilerplate.yaml b/.github/workflows/sync-aem-boilerplate.yaml index c7495a17..e2f08ab0 100644 --- a/.github/workflows/sync-aem-boilerplate.yaml +++ b/.github/workflows/sync-aem-boilerplate.yaml @@ -6,6 +6,14 @@ on: - cron: '0 6 * * *' workflow_dispatch: # Allow manual trigger +# ============================================ +# CONFIGURATION: Add files to sync here +# Format: "local/path:remote/path" (one per line) +# ============================================ +env: + SYNC_FILES: | + scripts/aem.js:scripts/aem.js + jobs: sync-aem-boilerplate: runs-on: ubuntu-latest @@ -17,23 +25,41 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download latest AEM Boilerplate from source + - name: Download files from AEM Boilerplate run: | - curl -sSL \ - -H "Accept: application/vnd.github.v3.raw" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://raw.githubusercontent.com/adobe/aem-boilerplate/main/scripts/aem.js?ref=main" \ - -o scripts/aem.js + echo "📥 Downloading files from adobe/aem-boilerplate..." + + while IFS= read -r mapping; do + # Skip empty lines + [[ -z "$mapping" ]] && continue + + # Parse local:remote mapping + local_path="${mapping%%:*}" + remote_path="${mapping##*:}" + + echo " → $remote_path → $local_path" + + # Ensure target directory exists + mkdir -p "$(dirname "$local_path")" + + # Download file (fail on HTTP errors) + curl -sSLf \ + "https://raw.githubusercontent.com/adobe/aem-boilerplate/main/$remote_path" \ + -o "$local_path" + done <<< "$SYNC_FILES" + + echo "✅ Download complete" - name: Check for changes id: changes run: | - if git diff --quiet scripts/aem.js; then + if git diff --quiet; then echo "changed=false" >> $GITHUB_OUTPUT - echo "✅ Already up to date" + echo "✅ All files are already up to date" else echo "changed=true" >> $GITHUB_OUTPUT - echo "🔄 Changes detected" + echo "🔄 Changes detected:" + git diff --name-only fi - name: Create Pull Request @@ -43,12 +69,17 @@ jobs: commit-message: "chore: sync AEM Boilerplate from adobe/aem-boilerplate" title: "🔄 Sync AEM Boilerplate from adobe/aem-boilerplate" body: | - This PR automatically syncs the files as configured in the `sync-aem-boilerplate.yml` workflow file from the upstream [adobe/aem-boilerplate](https://github.com/adobe/aem-boilerplate) repository. - + This PR automatically syncs files from the upstream [adobe/aem-boilerplate](https://github.com/adobe/aem-boilerplate) repository. + + **Files synced:** + ${{ env.SYNC_FILES }} + + **Source:** https://github.com/adobe/aem-boilerplate + --- _This PR was created automatically by a scheduled sync workflow._ branch: chore/sync-aem-boilerplate delete-branch: true labels: | automated - sync \ No newline at end of file + sync From dcc540937bf48c4399f3520eeaebdbdcc35abc64 Mon Sep 17 00:00:00 2001 From: Ramachandra Avuthu Date: Thu, 22 Jan 2026 14:53:11 -0500 Subject: [PATCH 4/4] Apply suggestion from @shsteimer Co-authored-by: Sean Steimer --- .github/workflows/sync-aem-boilerplate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-aem-boilerplate.yaml b/.github/workflows/sync-aem-boilerplate.yaml index e2f08ab0..57b6b395 100644 --- a/.github/workflows/sync-aem-boilerplate.yaml +++ b/.github/workflows/sync-aem-boilerplate.yaml @@ -78,7 +78,7 @@ jobs: --- _This PR was created automatically by a scheduled sync workflow._ - branch: chore/sync-aem-boilerplate + branch: sync-aem-boilerplate delete-branch: true labels: | automated