This action checks if the user is a stargazer (starred a repo or not). It can be run on Linux (ubuntu-latest
),
Windows (windows-latest
) or macOS (macos-latest
).
jobs:
is-stargazer:
runs-on: ubuntu-latest
steps:
- uses: gacts/is-stargazer@v1
id: check-star
#with:
# github-token: ${{ github.token }}
# username: ${{ github.actor }} # or ${{ github.event.pull_request.user.login }} for PR author
# repository: ${{ github.repository }}
- if: steps.check-star.outputs.is-stargazer != 'true'
uses: actions/github-script@v7
with:
script: core.setFailed('โญ Please, star this repository!')
In addition, you can combine this action with, for example, actions/github-script
:
on:
issues:
types: [opened]
jobs:
comment:
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@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'โญ Please, star this repository!'
})
The following inputs can be used as step.with
keys:
Name | Type | Default | Required | Description |
---|---|---|---|---|
github-token |
string |
${{ github.token }} |
no | GitHub token |
username |
string |
${{ github.actor }} |
no | GitHub username to check (eg. octocat ) |
repository |
string |
${{ github.repository }} |
no | Target repository (eg. octocat/Hello-World ) |
Name | Type | Description |
---|---|---|
is-stargazer |
string |
User starred a repo or not (true or false ) |
To release a new version:
- Build the action distribution (
make build
ornpm run build
). - Commit and push changes (including
dist
directory changes - this is important) to themaster|main
branch. - Publish the new release using the repo releases page (the git tag should follow the
vX.Y.Z
format).
Major and minor git tags (v1
and v1.2
if you publish a v1.2.Z
release) will be updated automatically.
Tip
Use Dependabot to keep this action updated in your repository.
If you find any errors in the action, please create an issue in this repository.
This is open-source software licensed under the MIT License.