-
Notifications
You must be signed in to change notification settings - Fork 173
36 lines (33 loc) · 1.16 KB
/
generate-cicd-zip.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Generate CICD Zip
on:
pull_request:
paths:
- 'template/{{.input_root_dir}}/.github/workflows/{{.input_project_name}}**'
- 'template/{{.input_root_dir}}/.azure/devops-pipelines/{{.input_project_name}}**'
defaults:
run:
working-directory: template/{{.input_root_dir}}
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- name: Generate CICD Zip
run: |
cp --parents .github/workflows/\{\{.input_project_name\}\}-* cicd/template
cp --parents .azure/devops-pipelines/\{\{.input_project_name\}\}-* cicd/template
tar -czvf cicd.tar.gz cicd
- name: Add Zip to Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git add cicd.tar.gz
git commit -m "Add CICD Zip to Pull Request"
git push