File tree 1 file changed +51
-0
lines changed
Filter options
1 file changed +51
-0
lines changed
Original file line number Diff line number Diff line change
1
+ name : Add License to Python Files
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ add-license :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout code
13
+ uses : actions/checkout@v2
14
+
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v3
17
+ with :
18
+ python-version : 3.10
19
+
20
+ - name : Run add_license.sh and check for changes
21
+ id : add_license
22
+ run : |
23
+ chmod +x scripts/add_license.sh
24
+ CHANGES=$(git status --porcelain)
25
+ ./scripts/add_license.sh
26
+ NEW_CHANGES=$(git status --porcelain)
27
+ echo "::set-output name=changes::${NEW_CHANGES}"
28
+
29
+ - name : Commit changes if there are modifications
30
+ run : |
31
+ if [[ -n "${{ steps.add_license.outputs.changes }}" ]]; then
32
+ git config --local user.email "dev-bot@jina.ai"
33
+ git config --local user.name "Jina Dev Bot"
34
+ git add .
35
+ git commit -m "chore: add license to Python files"
36
+ git push
37
+ else
38
+ echo "No changes detected, skipping commit."
39
+ fi
40
+ if : steps.add_license.outputs.changes != ''
41
+
42
+ - name : Create Pull Request
43
+ uses : peter-evans/create-pull-request@v3
44
+ with :
45
+ title : " Add license to Python files"
46
+ branch : " add-license"
47
+ commit-message : " chore: add license to Python files"
48
+ base : " main"
49
+ labels : " auto-merge"
50
+ token : ${{ secrets.JINA_DEV_BOT }}
51
+ if : steps.add_license.outputs.changes != ''
You can’t perform that action at this time.
0 commit comments