Skip to content

Commit 535b6e1

Browse files
committed
feat: new ci workflow to update configs from template repo
1 parent 1fd9d68 commit 535b6e1

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Update Configuration from Template
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
update:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout template repository
12+
uses: actions/checkout@v3
13+
with:
14+
repository: nimisha-gj/terraform-module-template
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
path: template-repo
17+
18+
- name: Checkout target repository
19+
uses: actions/checkout@v3
20+
with:
21+
repository: ${{ github.repository }}
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
path: target-repo
24+
25+
- name: Set up Git
26+
run: |
27+
git config --global user.name "github-actions"
28+
git config --global user.email "[email protected]"
29+
30+
- name: Copy files from template repository
31+
run: |
32+
cp template-repo/.editorconfig target-repo/
33+
cp template-repo/.pre-commit-config.yaml target-repo/
34+
cp template-repo/LICENSE target-repo/
35+
cp template-repo/.tflint.hcl target-repo/
36+
cp template-repo/.releaserc.json target-repo/
37+
cp template-repo/CODE_OF_CONDUCT.md target-repo/
38+
cp template-repo/CONTRIBUTING.md target-repo/
39+
40+
- name: Commit and push changes
41+
run: |
42+
cd target-repo
43+
git add .
44+
git commit -m "Update files from terraform-module-template"
45+
git push

0 commit comments

Comments
 (0)