Skip to content

fix: add GOPRIVATE and RELENG_GITHUB_TOKEN for private module access #1

fix: add GOPRIVATE and RELENG_GITHUB_TOKEN for private module access

fix: add GOPRIVATE and RELENG_GITHUB_TOKEN for private module access #1

Workflow file for this run

on:

Check failure on line 1 in .github/workflows/verify.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/verify.yaml

Invalid workflow file

(Line: 29, Col: 11): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.RELENG_GITHUB_TOKEN != '', (Line: 57, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.RELENG_GITHUB_TOKEN != ''
workflow_call:
inputs:
ref:
required: true
type: string
run_tests:
required: false
type: boolean
default: true
secrets:
RELENG_GITHUB_TOKEN:
required: false
description: "GitHub token with access to private ConductorOne repos (for baton-http imports)"
jobs:
lint:
runs-on: ubuntu-latest
env:
GOPRIVATE: github.com/conductorone/*
steps:
- name: Checkout caller repo
uses: actions/checkout@v5
with:
path: _caller
repository: ${{ github.event.repository.full_name }}
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Configure git for private modules
if: ${{ secrets.RELENG_GITHUB_TOKEN != '' }}
run: git config --global url."https://${{ secrets.RELENG_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: _caller/go.mod
- name: Run linters
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=3m
working-directory: _caller
test:
if: inputs.run_tests == true
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
env:
GOPRIVATE: github.com/conductorone/*
steps:
- name: Checkout caller repo
uses: actions/checkout@v5
with:
repository: ${{ github.event.repository.full_name }}
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Configure git for private modules
if: ${{ secrets.RELENG_GITHUB_TOKEN != '' }}
run: git config --global url."https://${{ secrets.RELENG_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: go tests
run: go test -v -covermode=count -json ./... | tee test.json
- name: annotate go tests
if: always()
uses: guyarb/golang-test-annotations@v0.8.0
with:
test-results: test.json