Skip to content

gacts/is-stargazer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Logo

Is the user stargazer?

Release version Build Status License

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).

Usage

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!'
            })

Customizing

Inputs

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)

Outputs

Name Type Description
is-stargazer string User starred a repo or not (true or false)

Releasing

New versions releasing scenario:

  • Make required changes in the changelog file
  • Build the action distribution (make build or yarn build)
  • Commit and push changes (including dist directory changes - this is important) into the master 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.

Support

Issues Issues

If you find any action errors, please, make an issue in the current repository.

License

This is open-sourced software licensed under the MIT License.