ci: automatically upgrade pyright to 1.1.382. #202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: (Procedure) Pull request | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-code-update: | |
runs-on: ubuntu-20.04 | |
outputs: | |
abort: ${{ steps.set-output.outputs.abort }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
- uses: actions/checkout@v3 | |
- id: set-output | |
name: Check if the code or workflows has been changed. | |
run: | | |
if [ $(git --no-pager diff --name-only origin/master HEAD -- pywhlobf | wc -l) -eq 0 ] \ | |
&& [ $(git --no-pager diff origin/master HEAD -- setup.cfg | wc -l) -eq 0 ] \ | |
&& [ $(git --no-pager diff --name-only origin/master HEAD -- .github | wc -l) -eq 0 ] | |
then | |
echo "abort=1" >> $GITHUB_OUTPUT | |
else | |
echo "abort=0" >> $GITHUB_OUTPUT | |
fi | |
call-workflow-type-checking: | |
uses: ./.github/workflows/workflow-type-checking.yaml | |
needs: check-code-update | |
if: needs.check-code-update.outputs.abort != 1 | |
call-workflow-test: | |
uses: ./.github/workflows/workflow-test.yaml | |
needs: check-code-update | |
if: needs.check-code-update.outputs.abort != 1 | |
signoff: | |
runs-on: ubuntu-20.04 | |
needs: [check-code-update, call-workflow-type-checking, call-workflow-test] | |
if: ${{ always() }} | |
steps: | |
- name: Signoff based on the previous jobs. | |
run: | | |
if [ "${{ needs.check-code-update.outputs.abort }}" = "1" ] ; then | |
exit 0 | |
else | |
if [ "${{ needs.call-workflow-type-checking.result }}" = "success" ] \ | |
&& [ "${{ needs.call-workflow-test.result }}" = "success" ] | |
then | |
exit 0 | |
else | |
exit 1 | |
fi | |
fi | |
- name: Auto approve for the project owner | |
run: | | |
gh pr review ${{ github.event.number }} --approve | |
if: github.event.sender.login == 'huntzhan' | |
env: | |
GH_TOKEN: ${{ secrets.VKIT_X_BOT_PAT }} | |
GH_REPO: ${{ github.repository }} |