From 12ccdf3cdcd5f2814dbfee9bcc9fe47ef8bd7e13 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 10 Apr 2025 20:01:25 -0500 Subject: [PATCH] Another attempt at properly bumping build number --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 831fe361..3a62b55f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + + - name: Check if commit is from GitHub Actions + id: check_actor + run: | + if [[ "${{ github.actor }}" == "github-actions" ]]; then + echo "is_bot=true" >> $GITHUB_OUTPUT + else + echo "is_bot=false" >> $GITHUB_OUTPUT + fi - name: Update build number run: | @@ -71,13 +88,22 @@ jobs: else echo "is_fork=false" >> $GITHUB_OUTPUT fi + - name: Increment Build Number + if: steps.check_actor.outputs.is_bot != 'true' id: increment_build run: | python scripts/increment_build.py BUILD=$(python -c "import version; print(version.__build__)") echo "build=${BUILD}" >> $GITHUB_OUTPUT + - name: Commit Build Number Update + if: steps.check_actor.outputs.is_bot != 'true' + run: | + git add version.py + git commit -m "Increment build number to ${{ steps.increment_build.outputs.build }} [skip ci]" + git push + - name: Build and push Docker image uses: docker/build-push-action@v4 with: