-
Notifications
You must be signed in to change notification settings - Fork 11
39 lines (33 loc) · 1.04 KB
/
build_counter.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
37
38
39
name: Count Action Executions
on:
push:
branches-ignore:
- main
jobs:
count_executions:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Choose the Python version you want to use
- name: Check if build.py needs update
id: check_changes
run: |
changes=$(git diff --name-only)
if [[ "$changes" == *"__version__.py"* ]]; then
echo "::set-output name=changes::0"
else
echo "::set-output name=changes::1"
fi
- name: Update build.py
if: steps.check_changes.outputs.changes != 0
run: |
OPTERYX_VERSION=$(python $GITHUB_WORKSPACE/build_counter.py)
git config --global user.name "XB500"
git config --global user.email "XB500@users.noreply.github.com"
git add $GITHUB_WORKSPACE/opteryx/__version__.py
git commit -m "Opteryx Version ${OPTERYX_VERSION}"
git push