diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4ab95d..521ad35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,20 +74,24 @@ jobs: vim --version make --keep-going $MAKE_TARGET - - name: Commit and push - if: success() && matrix.make_target == 'fast-test' && github.ref_name == 'master' + - name: Generate js and py + if: matrix.make_target == 'fast-test' && github.ref_name == 'master' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if ! make fast-check; then git config --local user.name 'github-actions[bot]' git config --local user.email 'github-actions[bot]@users.noreply.github.com' - git remote set-url origin 'https://github-actions:${{ github.token }}@github.com/${{ github.repository }}' + git switch -c bot/generate-jspy git add js/vimlparser.js py/vimlparser.py - git commit -m 'generate js and py' - git push origin '${{ github.ref_name }}' + git commit -m 'chore: generate js and py' + git push -u origin "$(git rev-parse --abbrev-ref @)" + gh pr create --base master --title 'chore: generate js and py' --body '' | tee /tmp/pull_request + gh pr merge "$(cat /tmp/pull_request)" --auto --merge --delete-branch fi - name: Coverage from Python - if: success() && matrix.make_target == 'fast-test' + if: always() && matrix.make_target == 'fast-test' run: | # Coverage from Python (cannot be combined with non-branch data). if [[ -f .coverage_covimerage ]]; then @@ -96,14 +100,14 @@ jobs: fi - name: Codecov for Python - if: success() && matrix.make_target == 'fast-test' - uses: codecov/codecov-action@v2 + if: matrix.make_target == 'fast-test' + uses: codecov/codecov-action@v3 with: files: coverage.xml flags: python - name: Coverage from Vim - if: success() + if: always() run: | # Coverage from Vim. covimerage write_coverage $TEST_PROFILE @@ -111,8 +115,7 @@ jobs: coverage xml - name: Codecov for Vim - if: success() - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: files: coverage.xml flags: vimscript