Skip to content

fix

fix #6

Workflow file for this run

name: Run tests
on:
workflow_call:
inputs:
event_name:
required: true
type: string
pr:
required: false
type: number
repo:
required: false
type: string
ref:
required: false
type: string
secrets:
GITHUB_TOKEN:

Check failure on line 18 in .github/workflows/run-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/run-tests.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
SONAR_TOKEN:
required: true
jobs:
go_test:
runs-on: ubuntu-latest
steps:
- name: checkout PR ${{ inputs.pr }}
if: ${{ inputs.event_name == 'pull_request_target' }}
uses: actions/[email protected]
with:
fetch-depth: 0 # for SonarQube
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
- name: checkout
if: ${{ inputs.event_name == 'push' }}
uses: actions/[email protected]
with:
fetch-depth: 0 # for SonarQube
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: "make verify"
- run: "make test"
- name: SonarQube for PR ${{ inputs.pr }}
if: ${{ inputs.event_name == 'pull_request_target' }}
uses: SonarSource/[email protected]
with:
args: >
-Dsonar.pullrequest.key=${{ inputs.pr }}
-Dsonar.scm.revision=${{ inputs.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarQube
if: ${{ inputs.event_name == 'push' }}
uses: SonarSource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}