Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a67a680

Browse files
committedApr 10, 2023
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 4b9fda4 commit a67a680

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
 

‎.github/workflows/test.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,20 @@ 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'
79+
env:
80+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7981
run: |
8082
if ! make fast-check; then
8183
git config --local user.name 'github-actions[bot]'
8284
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 }}'
85+
git switch -c bot/generate-jspy
8486
git add js/vimlparser.js py/vimlparser.py
85-
git commit -m 'generate js and py'
86-
git push origin '${{ github.ref_name }}'
87+
git commit -m 'chore: generate js and py'
88+
git push -u origin "$(git rev-parse --abbrev-ref @)"
89+
gh pr create --base master --title 'chore: generate js and py' --body '' | tee /tmp/pull_request
90+
gh pr merge "$(cat /tmp/pull_request)" --auto --merge --delete-branch
8791
fi
8892
8993
- name: Coverage from Python

0 commit comments

Comments
 (0)
Please sign in to comment.