Skip to content

fix(create-github-app-token): remove runtime dependency on jq#1948

Open
tolzhabayev wants to merge 1 commit into
grafana:mainfrom
tolzhabayev:fix/create-github-app-token-jq-dep
Open

fix(create-github-app-token): remove runtime dependency on jq#1948
tolzhabayev wants to merge 1 commit into
grafana:mainfrom
tolzhabayev:fix/create-github-app-token-jq-dep

Conversation

@tolzhabayev
Copy link
Copy Markdown
Contributor

Summary

The composite action shells out to jq to parse Vault responses, which breaks any caller running it inside a container without jq. Replaces the two jq calls with narrow sed extractions.

Failure example

publish-docs in grafana/business-calendar (and any other plugin using grafana/plugin-ci-workflows's cd.yml since v8.0.0) runs inside grafana/docs-base:latest, which is alpine + node and has no jq:

/__w/_actions/grafana/shared-workflows/.../actions/create-github-app-token/auth_vault.sh: line 22: jq: command not found
##[error]Process completed with exit code 127.

Repro:

docker run --rm grafana/docs-base:latest sh -c 'command -v jq || echo "no jq"'
# -> no jq

Test plan

  • test-create-github-app-token.yaml still passes on ubuntu-latest for both dev and ops vault instances
  • publish-docs succeeds end-to-end on a plugin repo once the new tag is consumed

The auth_vault.sh and create_token.sh scripts shelled out to jq to parse
Vault responses. This broke any caller that runs the action inside a
container without jq installed (e.g. publish-docs in
grafana/plugin-ci-workflows which uses grafana/docs-base:latest).

Replace the two jq invocations with narrow sed extractions. Vault's
response shape is stable and the values we read (Vault client token,
GitHub installation token) never contain quotes. Also fail-closed if
parsing produces an empty string instead of silently writing it to
GITHUB_OUTPUT.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant