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@v6
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@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!'
})
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 ) |
New versions releasing scenario:
- Make required changes in the changelog file
- Build the action distribution (
make build
oryarn build
) - Commit and push changes (including
dist
directory changes - this is important) into themaster
branch - Publish new release using repo releases page (git tag should follow
vX.Y.Z
format)
Major and minor git tags (v1
and v1.2
if you publish v1.2.Z
release) will be updated automatically.
If you find any action errors, please, make an issue in the current repository.
This is open-sourced software licensed under the MIT License.