Skip to content

Commit

Permalink
feat: add filtering, pipeline, and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jef committed Jan 6, 2021
1 parent c421872 commit 8a46342
Show file tree
Hide file tree
Showing 15 changed files with 786 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jef
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: jef
custom: ["https://www.paypal.me/jxf"]
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "\U0001F41B Bug report"
about: Report a bug for this project
title: ''
labels: ''
assignees: ''

---

## Expected Behavior

<!-- Tell us what should happen -->

## Current Behavior

<!-- Tell us what happens instead of the expected behavior -->

## Steps to Reproduce

<!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. -->
<!-- Include code to reproduce, if relevant -->

## Environment

- OS:
- Flags:

## Logs

<!-- Provide a brief log -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 💡 Have an idea for a new feature?
url: https://github.com/jef/stargazer-vanity/discussions
about: Create a new idea discussion!
- name: 🙇 Need help with stargazer-vanity?
url: https://github.com/jef/stargazer-vanity/discussions
about: Create a new help discussion if it hasn't been asked before!
14 changes: 14 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Please use Conventional Commits to label your title -->
<!-- https://www.conventionalcommits.org/en/v1.0.0/ -->
<!-- Example: feat: allow provided config object to extend other configs -->

### Description

<!-- Fixes #(issue) -->
<!-- Please also include relevant motivation and context. -->

### Testing

<!-- Please describe the tests that you ran to verify your changes. -->
<!-- Provide instructions so we can reproduce. -->
<!-- Please also list any relevant details for your test configuration -->

### New dependencies

<!-- List any dependencies that are required for this change. -->
<!-- Otherwise, delete section. -->
58 changes: 58 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: cd
on:
push:
branches:
- main
jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: google-github-actions/[email protected]
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
package-name: stargazer-vanity
- name: Retrieve latest tag
run: echo "TAG=$(cat version.txt)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: '1.15'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Build release assets
run: make dist
- name: Upload Windows asset
if: ${{ steps.release.outputs.release_created }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./svg.exe
asset_name: svg-windows-amd64.exe
asset_content_type: application/octet-stream
- name: Upload Linux asset
if: ${{ steps.release.outputs.release_created }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./svg.linux
asset_name: svg-linux-amd64
asset_content_type: application/octet-stream
- name: Upload macOS asset
if: ${{ steps.release.outputs.release_created }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./svg.darwin
asset_name: svg-darwin-amd64
asset_content_type: application/octet-stream
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Build
run: make
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.15'
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Lint
run: |
go get -u golang.org/x/lint/golint
golint -set_exit_status
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.idea/

# Binaries for programs and plugins
*.exe
*.linux
*.macos
*.exe~
*.dll
*.so
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DEFAULT_GOAL := build

.PHONY: build
build:
go build -o sgv

.PHONY: clean
clean:
rm -rf sgv

.PHONY: dist
dist:
GOOS=windows GOARCH=amd64 go build -o svg.exe
GOOS=linux GOARCH=amd64 go build -o svg.linux
GOOS=darwin GOARCH=amd64 go build -o svg.darwin
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# stargazer-vanity [![cd](https://github.com/jef/stargazer-vanity/workflows/cd/badge.svg)](https://github.com/jef/stargazer-vanity/actions?query=workflow%3Acd+branch%3Amain)

- **star·gaz·er** `/ˈstärˌɡāzər/` Someone that has starred a repository.
- **van·i·ty** `/ˈvanədē/` Excessive pride in or admiration of one's own appearance or achievements.

I created this out of pure vanity, hence the name. I was curious as to who has starred my repositories (and others) and what companies they worked for.

This allows programs lets a user understand that data without parsing through _many_ pages of stargazers.

## Usage

It is required that you use a GitHub Personal Access Token (PAT). You can generate one [here](https://github.com/settings/tokens/new). The required scopes are `['read:org', 'user:email', 'read:user']`. Set your PAT to environment variable `GITHUB_PAT`. If `GITHUB_PAT` isn't set, you will be prompted for your PAT in the beginning of startup.

```
Usage of ./stargazer-vanity:
-company string
Filter stargazers by company name(s). Can be comma separated.
If no names are given, then all stargazers will output.
-employee
Filter stargazers that are GitHub employees.
-repo string
(Required) The name of the repository.
-owner string
(Required) The owner or organization of the repository.
```

### Examples

- Amazon, Google, and GitHub employees for [cli/cli](https://github.com/cli/cli)
- `./stargazer-vanity -company=amazon,google -employee -owner=cli -repo=cli`
- Nvidia employees for [jef/streetmerchant](https://github.com/jef/streetmerchant)
- `./stargazer-vanity -company=nvidia -owner=jef -repo=streetmerchant`

## Development

- `make build`: Builds source
- `make clean`: Cleans executable
- `make dist`: Cross-compilation for distribution
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/jef/stargazer-vanity

go 1.15

require (
github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5
)
Loading

0 comments on commit 8a46342

Please sign in to comment.