File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Unity Version Badge
2+
3+ on :
4+ push :
5+ paths :
6+ - ' ProjectSettings/ProjectVersion.txt'
7+ workflow_dispatch :
8+
9+ jobs :
10+ update-badge :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v2
15+
16+ - name : Read Unity Version
17+ id : read_unity_version
18+ run : |
19+ unity_version=$(grep -oP 'm_EditorVersion: \K.*' ProjectSettings/ProjectVersion.txt)
20+ echo "UNITY_VERSION=$unity_version" >> $GITHUB_ENV
21+
22+ - name : Update README with Badge
23+ run : |
24+ badge_url="https://img.shields.io/badge/Unity-$UNITY_VERSION-brightgreen"
25+ sed -i 's|!\[Unity\](.*)||' README.md
26+
27+ - name : Commit changes
28+ run : |
29+ git config --global user.name 'github-actions'
30+ git config --global user.email '[email protected] ' 31+ git add README.md
32+ git commit -m "Update Unity version badge to $UNITY_VERSION"
33+ git push
You can’t perform that action at this time.
0 commit comments