-
Notifications
You must be signed in to change notification settings - Fork 55
36 lines (29 loc) · 1.07 KB
/
Copy pathgenerator.yaml
File metadata and controls
36 lines (29 loc) · 1.07 KB
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 on Pull Request
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
generate:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Run generators.py
run: python generators.py
- name: Commit and push changes
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --global --add --bool push.autoSetupRemote true
echo "Committing changes and pushing to ${{ github.ref_name }}"
git diff --quiet && git diff --staged --quiet || git commit -am "${{ github.ref_name }}: Update generated files" && git push -u origin ${{ github.ref_name }} && echo "Pushed changes to ${{ github.ref_name }}"
echo "Done"