-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
288 additions
and
592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: 💡 Have an idea for a new feature? | ||
url: https://github.com/jef/stargazer-vanity/discussions | ||
url: https://github.com/jef/gh-vanity/discussions | ||
about: Create a new idea discussion! | ||
- name: 🙇 Need help with stargazer-vanity? | ||
url: https://github.com/jef/stargazer-vanity/discussions | ||
- name: 🙇 Need help with gh-vanity? | ||
url: https://github.com/jef/gh-vanity/discussions | ||
about: Create a new help discussion if it hasn't been asked before! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,60 +4,29 @@ on: | |
branches: | ||
- main | ||
jobs: | ||
build-tag-release: | ||
name: Build, tag, and release assets | ||
release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Setup release please | ||
uses: google-github-actions/release-please-action@v2 | ||
id: release | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: simple | ||
package-name: stargazer-vanity | ||
- name: Retrieve latest tag | ||
run: echo "TAG=$(cat version.txt)" >> $GITHUB_ENV | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16' | ||
- name: Setup build cache | ||
uses: actions/[email protected] | ||
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: ./stargazer-vanity.exe | ||
asset_name: sgv-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: ./stargazer-vanity.linux | ||
asset_name: sgv-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 }} | ||
package-name: gh-vanity | ||
upload_assets: | ||
name: Upload assets | ||
runs-on: ubuntu-latest | ||
needs: release | ||
if: needs.release.outputs.release_created == 'true' | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- uses: cli/gh-extension-precompile@v1 | ||
with: | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
asset_path: ./stargazer-vanity.darwin | ||
asset_name: sgv-darwin-amd64 | ||
asset_content_type: application/octet-stream | ||
go_version: "1.19" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,73 @@ | ||
# stargazer-vanity [![Release](https://img.shields.io/github/workflow/status/jef/stargazer-vanity/Release?color=24292e&label=Release&logo=github&logoColor=white&style=flat-square)](https://github.com/jef/stargazer-vanity/actions/workflows/release.yaml) | ||
|
||
> **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. | ||
# gh-vanity [![Release](https://github.com/jef/gh-vanity/actions/workflows/release.yaml/badge.svg)](https://github.com/jef/gh-vanity/actions/workflows/release.yaml) | ||
|
||
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. | ||
|
||
## Installation | ||
|
||
Download the specific binary from [GitHub Releases](https://github.com/jef/stargazer-vanity/releases) or use `go get`: | ||
1. Install the `gh` cli - see the [installation](https://github.com/cli/cli#installation) | ||
|
||
```shell | ||
go get -u github.com/jef/stargazer-vanity | ||
``` | ||
_Installation requires a minimum version (2.0.0) of the GitHub CLI that supports extensions._ | ||
|
||
## Usage | ||
2. Install this extension: | ||
|
||
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. | ||
```shell | ||
gh extension install jef/gh-vanity | ||
``` | ||
|
||
``` | ||
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. | ||
``` | ||
<details> | ||
<summary><strong>Manual Installation</strong></summary> | ||
|
||
### Examples | ||
Requirements: `cli/cli` and `go`. | ||
|
||
Filter Amazon, Google, and GitHub employees for [cli/cli](https://github.com/cli/cli): | ||
1. Clone the repository | ||
|
||
``` | ||
./stargazer-vanity -company=amazon,google -employee -owner=cli -repo=cli | ||
``` | ||
```shell | ||
# git | ||
git clone [email protected]:jef/gh-vanity.git | ||
# GitHub CLI | ||
gh repo clone jef/gh-vanity | ||
``` | ||
|
||
2. `cd` into it | ||
|
||
```shell | ||
cd gh-vanity | ||
``` | ||
|
||
3. Build it | ||
|
||
Filter Nvidia employees for [jef/streetmerchant](https://github.com/jef/streetmerchant): | ||
```shell | ||
make build | ||
``` | ||
|
||
4. Install it locally | ||
|
||
```shell | ||
gh extension install . | ||
``` | ||
</details> | ||
|
||
## Usage | ||
|
||
To run: | ||
|
||
```shell | ||
gh vanity | ||
``` | ||
./stargazer-vanity -company=nvidia -owner=jef -repo=streetmerchant | ||
|
||
To upgrade: | ||
|
||
```sh | ||
gh extension upgrade vanity | ||
``` | ||
|
||
## Development | ||
### Examples | ||
|
||
Filter Amazon, Google, and GitHub employees for [jef/streetmerchant](https://github.com/jef/streetmerchant): | ||
|
||
- `make build`: Builds source | ||
- `make clean`: Cleans executable | ||
- `make dist`: Cross-compilation for distribution | ||
```shell | ||
gh vanity --company=amazon,google --employee --owner=jef --name=streetmerchant | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module github.com/jef/stargazer-vanity | ||
module github.com/jef/gh-vanity | ||
|
||
go 1.16 | ||
|
||
require ( | ||
github.com/cli/go-gh v0.1.1 | ||
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 | ||
github.com/spf13/cobra v1.5.0 | ||
) |
Oops, something went wrong.