Skip to content

Commit

Permalink
Rewrite CLI in Go
Browse files Browse the repository at this point in the history
Signed-off-by: Brett Logan <[email protected]>
  • Loading branch information
Link- authored and lindluni committed Sep 10, 2023
1 parent e723b28 commit 68fb183
Show file tree
Hide file tree
Showing 15 changed files with 739 additions and 1,476 deletions.
File renamed without changes.
59 changes: 18 additions & 41 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,29 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base
name: MegaLinter

#
# 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:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
megalinter:
name: MegaLinter
runs-on: ubuntu-latest

##################
# Load all steps #
##################
permissions:
contents: write
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
- name: MegaLinter
uses: oxsecurity/megalinter@v7
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: >-
${{
github.event_name == 'push' &&
contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref)
}}
34 changes: 7 additions & 27 deletions .github/workflows/release.yml
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
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@ tags
.keys

### Project files
jwt
jwt

# Generated files
gh-token
gh-token.exe

# Test app keys
*.pem
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

Loading

0 comments on commit 68fb183

Please sign in to comment.