fix: change import from RequestRate to Rate #86
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: Reply to issue comments | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| issues: write | |
| jobs: | |
| reply: | |
| runs-on: ubuntu-latest | |
| if: contains(github.event.comment.body, '@njzjz-bot') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Extract identifiers | |
| id: extract-identifiers | |
| run: | | |
| echo identifiers=$(echo "${{ github.event.comment.body }}" | grep -oE '@njzjz-bot .*' | head -n1 | cut -c12- | xargs) >> $GITHUB_OUTPUT | |
| - name: Run wenxian | |
| id: wenxian | |
| uses: ./ | |
| with: | |
| id: ${{ steps.extract-identifiers.outputs.identifiers }} | |
| - name: Prepare the comment body | |
| id: prepare-comment | |
| run: | | |
| { | |
| echo 'comment<<EOF' | |
| echo '@${{ github.event.comment.user.login }} Here is the BibTeX entry for `${{ steps.extract-identifiers.outputs.identifiers }}`:' | |
| echo '```bibtex' | |
| echo "${OUTPUT_BIBTEX}" | |
| echo '```' | |
| echo EOF | |
| } >> $GITHUB_OUTPUT | |
| env: | |
| OUTPUT_BIBTEX: ${{ steps.wenxian.outputs.bibtex }} | |
| - name: Post comment | |
| run: | | |
| echo "${OUTPUT_COMMENT}" | gh issue comment ${{ github.event.issue.number }} --body-file - | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| OUTPUT_COMMENT: ${{ steps.prepare-comment.outputs.comment }} |