Skip to content

Commit 656dbda

Browse files
committed
Fix action to generate js and py
since master branch is protected, to update js and py create pull-request and do auto-merging in action.
1 parent cdd5dcd commit 656dbda

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/test.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,18 @@ jobs:
7474
vim --version
7575
make --keep-going $MAKE_TARGET
7676
77-
- name: Commit and push
78-
if: success() && matrix.make_target == 'fast-test' && github.ref_name == 'master'
77+
- name: Generate js and py
78+
if: matrix.make_target == 'fast-test' && github.ref_name == 'master'
7979
run: |
8080
if ! make fast-check; then
8181
git config --local user.name 'github-actions[bot]'
8282
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
83-
git remote set-url origin 'https://github-actions:${{ github.token }}@github.com/${{ github.repository }}'
83+
git switch -c bot/generate-jspy
8484
git add js/vimlparser.js py/vimlparser.py
85-
git commit -m 'generate js and py'
86-
git push origin '${{ github.ref_name }}'
85+
git commit -m 'chore: generate js and py'
86+
git push -u origin "$(git rev-parse --abbrev-ref @)"
87+
gh pr create --base master --title 'chore: generate js and py' --body '' | tee /tmp/pull_request
88+
gh pr merge "$(cat /tmp/pull_request)" --auto --merge --delete-branch
8789
fi
8890
8991
- name: Coverage from Python

0 commit comments

Comments
 (0)