用自己找的其中一个api会报错 #7
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: Check if user has starred the repository | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
check-star: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: gacts/is-stargazer@v1 | |
id: check-star | |
- if: steps.check-star.outputs.is-stargazer != 'true' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '⭐ Please, star this repository!' | |
}) | |
- if: ${{ steps.check-star.outputs.is-stargazer != 'true' && github.actor != 'github-actions[bot]' }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.update({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
state: 'closed' | |
}) |