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 Jan 16, 2022
1 parent cdd5dcd commit 656dbda
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@ 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'
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
Expand Down

0 comments on commit 656dbda

Please sign in to comment.