Remove tabs from dev env #1168
Workflow file for this run
This file contains hidden or 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: Style | |
| on: | |
| pull_request: | |
| jobs: | |
| review: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout scripts directory | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: vaadin/docs | |
| path: . | |
| sparse-checkout: scripts/ | |
| - uses: actions4gh/[email protected] | |
| - name: Fetch changes and review them | |
| id: review | |
| run: | | |
| # Run the script to fetch changes and send them to OpenAI | |
| R=`./scripts/style-check/style-check.sh ${{ github.event.pull_request.number }} ${{ github.repository }}` || exit 1 | |
| # show response from OpenAI | |
| set -x | |
| R=`echo "$R" | jq -r '.choices[0].message.content'` || exit 1 | |
| set +x | |
| [ -z "$R" ] && echo "Nothing to review" && exit 0 | |
| # store response in output variable 'result' | |
| echo "result<<EOF" >> $GITHUB_OUTPUT | |
| echo -e "$R" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_TOKEN }} | |
| shell: bash | |
| - if: ${{ success() }} | |
| uses: peter-evans/find-comment@v3 | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-includes: AI Language Review | |
| - if: ${{ success() && steps.review.outputs.result }} | |
| uses: peter-evans/create-or-update-comment@v3 | |
| with: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| edit-mode: replace | |
| body: | | |
| ## AI Language Review | |
| ${{ steps.review.outputs.result }} | |
| - if: ${{ success() && steps.fc.outputs.comment-id && !steps.review.outputs.result }} | |
| run: gh api --method DELETE /repos/${{ github.repository }}/issues/comments/${{ steps.fc.outputs.comment-id }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |