Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github action to generate connector capabilities. #40

Merged
merged 3 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/capabilities.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Output connector capabilities

on:
push:
branches:
- main

jobs:
calculate-capabilities:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.RELENG_GITHUB_TOKEN }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Build
run: go build -o connector ./cmd/baton-okta

- name: Run and save output
env:
BATON_API_TOKEN: ${{ secrets.BATON_API_TOKEN }}
BATON_DOMAIN: ${{ secrets.BATON_DOMAIN }}
run: ./connector capabilities > baton_capabilities.json

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'Updating baton capabilities.'
add: 'baton_capabilities.json'
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -24,13 +24,13 @@ jobs:
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: go tests
run: go test -v -covermode=count -json ./... > test.json
run: (set -o pipefail && go test -v -covermode=count -json ./... | tee test.json)
- name: annotate go tests
if: always()
uses: guyarb/[email protected]
Expand All @@ -51,7 +51,7 @@ jobs:
CONNECTOR_PRINCIPAL: '00ug0t0xjvnHRbQuD5d7'
steps:
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout code
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run linters
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -27,13 +27,13 @@ jobs:
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: go tests
run: go test -v -covermode=count -json ./... > test.json
run: (set -o pipefail && go test -v -covermode=count -json ./... | tee test.json)
- name: annotate go tests
if: always()
uses: guyarb/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Set up Gon
Expand All @@ -37,11 +37,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Docker Login
Expand Down
4 changes: 2 additions & 2 deletions pkg/connector/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type responseContext struct {
requestID string

status string
statusCode uint32
statusCode int

hasRateLimit bool
rateLimit int64
Expand Down Expand Up @@ -77,7 +77,7 @@ func responseToContext(token *pagination.Token, resp *okta.Response) (*responseC
token: token,
requestID: resp.Header.Get(oktaRequestIDHeader),
status: resp.Status,
statusCode: uint32(resp.StatusCode),
statusCode: resp.StatusCode,
OktaResponse: resp,
}

Expand Down
Loading