Skip to content

Commit

Permalink
Fix action to generate js and py
Browse files Browse the repository at this point in the history
since master branch is protected, to update js and py create
pull-request and do auto-merging in action.
  • Loading branch information
ichizok committed Apr 9, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7289c52 commit d899e79
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -74,16 +74,20 @@ 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

0 comments on commit d899e79

Please sign in to comment.