mirror of https://github.com/grafana/grafana.git
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: 'Setup Grafana Bench'
|
|
description: 'Sets up and installs Grafana Bench'
|
|
|
|
inputs:
|
|
github-app-name:
|
|
description: 'Name of the GitHub App in Vault'
|
|
required: false
|
|
default: 'grafana-ci-bot'
|
|
branch:
|
|
description: 'The branch to install from'
|
|
required: false
|
|
default: 'main'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Retrieve GitHub App secrets
|
|
id: get-secrets
|
|
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets-v1.0.1 # zizmor: ignore[unpinned-uses]
|
|
with:
|
|
repo_secrets: |
|
|
APP_ID=${{ inputs.github-app-name }}:app-id
|
|
APP_INSTALLATION_ID=${{ inputs.github-app-name }}:app-installation-id
|
|
PRIVATE_KEY=${{ inputs.github-app-name }}:private-key
|
|
|
|
- name: Generate GitHub App token
|
|
id: generate_token
|
|
uses: actions/create-github-app-token@v1
|
|
with:
|
|
app-id: ${{ env.APP_ID }}
|
|
private-key: ${{ env.PRIVATE_KEY }}
|
|
repositories: "grafana-bench"
|
|
owner: "grafana"
|
|
|
|
- name: Setup Bench
|
|
shell: bash
|
|
env:
|
|
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
|
BRANCH: ${{ inputs.branch }}
|
|
run: |
|
|
git clone https://x-access-token:${GH_TOKEN}@github.com/grafana/grafana-bench.git ../grafana-bench
|
|
|
|
cd ../grafana-bench
|
|
git switch "$BRANCH"
|
|
go install .
|