-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewrite CLI in Go Signed-off-by: Brett Logan <[email protected]> * Update flag names and aliases to preserve backwards compatibility Signed-off-by: Brett Logan <[email protected]> * Update image Signed-off-by: Brett Logan <[email protected]> * Update deps Signed-off-by: Brett Logan <[email protected]> * Adjust newlines Signed-off-by: Brett Logan <[email protected]> * Reorder variable declaration Signed-off-by: Brett Logan <[email protected]> * Add makefile * Remove funding * Add updated banner * Return empty array if are no installations * Default the jwt duration to 10 minutes if not provided or outside of boundaries * Fix malformatted token response * Fix README --------- Signed-off-by: Brett Logan <[email protected]> Co-authored-by: Bassem Dghaidi <[email protected]>
- Loading branch information
Showing
21 changed files
with
852 additions
and
1,486 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '41 2 * * 6' | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: 'ubuntu-latest' | ||
timeout-minutes: 15 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: go | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: "/language:go" |
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,52 +1,25 @@ | ||
--- | ||
################################# | ||
################################# | ||
## Super Linter GitHub Actions ## | ||
################################# | ||
################################# | ||
name: Lint Code Base | ||
name: Lint | ||
|
||
# | ||
# Documentation: | ||
# https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
# | ||
|
||
############################# | ||
# Start the job on all push # | ||
############################# | ||
on: | ||
push: | ||
branches-ignore: [master, main] | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
############### | ||
# Set the Job # | ||
############### | ||
jobs: | ||
build: | ||
# Name the Job | ||
name: Lint Code Base | ||
# Set the agent to run on | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
################## | ||
# Load all steps # | ||
################## | ||
steps: | ||
########################## | ||
# Checkout the code base # | ||
########################## | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
# Full git history is needed to get a proper list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
################################ | ||
# Run Linter against code base # | ||
################################ | ||
- name: Lint Code Base | ||
uses: github/super-linter@v4 | ||
env: | ||
VALIDATE_ALL_CODEBASE: true | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Lint Code | ||
uses: golangci/golangci-lint-action@v3 |
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,34 +1,14 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'gh-token' | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
Update: | ||
# The type of runner that the job will run on | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: "Checkout repo" | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Calculate new SHA256 hash" | ||
run: | | ||
new_sha="$(shasum -a 256 gh-token | sed -r 's/gh-token/ghtoken/g')" | ||
sed -r "s/echo \"[0-9a-f]{64} ghtoken\"/echo \"$new_sha\"/g" -i README.md | ||
- name: "Commit and push updates" | ||
uses: EndBug/add-and-commit@a3adef035a1381dcf888c90b847240e2ddb9e008 | ||
with: | ||
author_name: Link- | ||
author_email: '[email protected]' | ||
message: 'Updating sha256 hash value' | ||
add: 'README.md' | ||
- uses: actions/checkout@v3 | ||
- uses: cli/gh-extension-precompile@v1 |
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 |
---|---|---|
|
@@ -61,4 +61,11 @@ tags | |
.keys | ||
|
||
### Project files | ||
jwt | ||
jwt | ||
|
||
# Generated files | ||
gh-token | ||
gh-token.exe | ||
|
||
# Test app keys | ||
*.pem |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Makefile with the following targets: | ||
# all: build the project | ||
# clean: remove all build artifacts | ||
# build: build the project | ||
# help: print this help message | ||
# .PHONY: mark targets as phony | ||
# .DEFAULT_GOAL: set the default goal to all | ||
|
||
# Set the default goal to all | ||
.DEFAULT_GOAL := all | ||
PROJECT_NAME := "gh-token" | ||
|
||
# Mark targets as phony | ||
.PHONY: all clean build | ||
|
||
# Build the project | ||
all: clean build | ||
|
||
# Remove all build artifacts | ||
clean: | ||
rm gh-token | ||
|
||
# Build the project | ||
build: | ||
go build -o gh-token . |
Oops, something went wrong.