Skip to content
star

GitHub Action

Is the user stargazer?

v1.1.1 Latest version

Is the user stargazer?

star

Is the user stargazer?

Checks if the user is a stargazer (starred a repo or not)

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Is the user stargazer?

uses: gacts/[email protected]

Learn more about this action in gacts/is-stargazer

Choose a version

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

Customizing

Inputs

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)

Outputs

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

Releasing

To release a new version:

  • Build the action distribution (make build or npm run build).
  • Commit and push changes (including dist directory changes - this is important) to the master|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.

Support

Issues Pull Requests

If you find any errors in the action, please create an issue in this repository.

License

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