diff --git a/.github/workflows/increment-build-number.yml b/.github/workflows/increment-build-number.yml index 18b8e18c..66ade70b 100644 --- a/.github/workflows/increment-build-number.yml +++ b/.github/workflows/increment-build-number.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - '*-develop' types: - closed paths: @@ -17,6 +18,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} - name: Setup PHP uses: "shivammathur/setup-php@v2" @@ -46,24 +49,19 @@ jobs: continue-on-error: true run: bin/gendoc - - name: Commit api docs - if: steps.generate-api-docs.outcome == 'success' - continue-on-error: true - run: | - git config --global user.name 'Github Build Bot' - git config --global user.email 'noreply@github.com' - git add docs - git commit -m "update api docs" - git push + - name: Commit API Docs + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: update api docs - name: Increment build number - run: sed -i -r 's/(.*)(\VERSION_ID\s=\s)([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' src/ZM/ConsoleApplication.php + id: increment-build-number + run: | + sed -i -r 's/(.*)(\VERSION_ID\s=\s)([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' src/ZM/Framework.php + BUILD_ID=$(cat src/ZM/Framework.php | grep "VERSION_ID = " | sed 's/[^0-9]//g') + echo "::set-output name=build_id::$BUILD_ID" - name: Commit build number - run: | - BUILD_ID=$(cat src/ZM/ConsoleApplication.php | grep "VERSION_ID = " | sed 's/[^0-9]//g') - git config --global user.name 'Github Build Bot' - git config --global user.email 'noreply@github.com' - git add src/ZM/ConsoleApplication.php - git commit -m "increment build number (build $BUILD_ID)" - git push + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: increment build number (build ${{ steps.increment-build-number.outputs.build_id }}) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index c3a876ac..ace57c31 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -4,11 +4,13 @@ on: push: branches: - master + - '*-develop' paths: - '**/**.php' pull_request: branches: - master + - '*-develop' types: - opened - synchronize