Skip to content

Commit 03033a8

Browse files
authored
Merge pull request #79 from adobe/gh-cleanup-wf
chore: adding cleanup-on-create.yaml as in aem-boilerplate
2 parents 1240044 + ddd84c3 commit 03033a8

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will run upon repository creation and clean up
2+
# all files that are not strictly required to build an AEM Live project
3+
# but that we use to develop the project template. This includes this
4+
# particular workflow file.
5+
on:
6+
create:
7+
branches:
8+
- main
9+
workflow_dispatch: null
10+
jobs:
11+
cleanup:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
actions: write
16+
if: ${{ github.event_name == 'workflow_dispatch' || ( github.ref ==
17+
'refs/heads/main' && !(contains(github.event, 'head_commit') ||
18+
github.event.head_commit.message == 'Initial commit' )) }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Use Node.js 20
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
- name: Remove Helper Files
27+
run: |
28+
rm -rf \
29+
.github/workflows/cleanup-on-create.yaml \
30+
CHANGELOG.md
31+
- name: Initialize README
32+
run: |
33+
sed -i.bak "s/{repo}/$(basename ${{ github.repository }})/g" README.md
34+
sed -i.bak "s/{owner}/$(dirname ${{ github.repository }})/g" README.md
35+
- name: Initialize Pull Request Template
36+
run: >
37+
sed -i.bak "s/{repo}/$(basename ${{ github.repository }})/g"
38+
.github/pull_request_template.md
39+
40+
sed -i.bak "s/{owner}/$(dirname ${{ github.repository }})/g" .github/pull_request_template.md
41+
- name: Commit changes
42+
run: |
43+
git config --local user.email "[email protected]"
44+
git config --local user.name "AEM Bot"
45+
git add .
46+
git commit -m "chore: cleanup repository template"
47+
git push

0 commit comments

Comments
 (0)