Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding cleanup-on-create.yaml as in aem-boilerplate #79

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
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
47 changes: 47 additions & 0 deletions .github/workflows/cleanup-on-create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will run upon repository creation and clean up
# all files that are not strictly required to build an AEM Live project
# but that we use to develop the project template. This includes this
# particular workflow file.
on:
create:
branches:
- main
workflow_dispatch: null
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
if: ${{ github.event_name == 'workflow_dispatch' || ( github.ref ==
'refs/heads/main' && !(contains(github.event, 'head_commit') ||
github.event.head_commit.message == 'Initial commit' )) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Remove Helper Files
run: |
rm -rf \
.github/workflows/cleanup-on-create.yaml \
CHANGELOG.md
- name: Initialize README
run: |
sed -i.bak "s/{repo}/$(basename ${{ github.repository }})/g" README.md
sed -i.bak "s/{owner}/$(dirname ${{ github.repository }})/g" README.md
- name: Initialize Pull Request Template
run: >
sed -i.bak "s/{repo}/$(basename ${{ github.repository }})/g"
.github/pull_request_template.md

sed -i.bak "s/{owner}/$(dirname ${{ github.repository }})/g" .github/pull_request_template.md
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "AEM Bot"
git add .
git commit -m "chore: cleanup repository template"
git push