Skip to content

Releases: mozership/probe-graphql

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 12:16
b571ec3
uses: github.com/mozership/probe-graphql@41e4ffa222db58c63c7169117c919e6d252bdbf9 # v0.2.0

Highlights

  • The action now keeps to the guard of a run, and its action.yml declares guard: [read-only, allow-host], so Probe v1.21.0 or later runs it under --read-only and --allow-host without --allow-action.
  • Its action.yml declares params, so probe check reports a key of with the action does not take.
  • A key of with the action does not take now fails the step.

Keeping to the guard

The action used to keep to no guard, so a step that used it was refused under --read-only or --allow-host unless --allow-action named it. It now refuses, before anything is sent, what the guard does not allow, and the step fails with the kind refused:

  • Under --read-only, only a query is sent. The operation to run, the one operation_name names or the only one in the document, is read with gqlparser. A mutation or a subscription is refused, and so is a document that does not parse, one with several operations and no operation_name, and an operation_name the document does not have.
  • Under --allow-host, the host of url, and of each redirect, must be one the run allows. A URL without a port is taken at the port of its scheme.

Parameters

params: [url, query, variables, operation_name, headers, timeout] in action.yml lets probe check report a misspelled key with its line. The action checks the same list itself, so a key that is not one of them fails the step before anything is sent; it used to be ignored.

Requirements

The action runs on Probe v1.17.0 or later as before. Running it under a guard, and having probe check check its with, need Probe v1.21.0 or later. See GraphQL.

Changelog

  • 18e0ed3 Keep to the guard of a run, and declare it and the params in action.yml
  • b571ec3 Merge pull request #2 from mozership/keep-to-the-guard
  • ad456d1 Point action.yml at v0.1.1

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 09 Oct 03:52
c255e86
uses: github.com/mozership/probe-graphql@ad456d1eefd30a63d14b49c730e5239c4749b34b # v0.1.1

Highlights

  • The same action as v0.1.0, released from mozership/probe-graphql, where the repository moved from linyows.
  • Its action.yml downloads the executables from this repository's release, rather than through GitHub's redirect from linyows.
  • Nothing else changes: the same with, the same result, Probe v1.17.0 or later.

The move to mozership

  • The module path is now github.com/mozership/probe-graphql, and the README, the uses form and scripts/action-yml.sh name mozership.
  • A step pinned to v0.1.0 under github.com/linyows/probe-graphql still resolves through GitHub's redirect. Pinning the commit above under github.com/mozership/probe-graphql needs no redirect at all.

See GraphQL.

Changelog

  • 73f5968 Link to Probe where it is now, mozership/probe
  • c255e86 Merge pull request #1 from mozership/move-to-mozership
  • ec94f2c Name the repository by its current owner, mozership
  • f9e7b84 Point action.yml at v0.1.0

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 04 Oct 22:11
7edaf9e
uses: github.com/linyows/probe-graphql@f9e7b841b87dccbcbe71ae10f8562aa637d52a51 # v0.1.0

Highlights

  • The first release: a Probe action that sends a GraphQL query or mutation over HTTP, and returns the data and errors of the response apart.
  • It is an external action, the first one, for Probe v1.17.0 or later.
  • The repository has since moved to mozership/probe-graphql. v0.1.1 is the same action, released from there.

Sending a query

- name: Look up Japan
  uses: github.com/linyows/probe-graphql@f9e7b841b87dccbcbe71ae10f8562aa637d52a51 # v0.1.0
  with:
    url: https://countries.trevorblades.com/graphql
    query: |
      query Country($code: ID!) {
        country(code: $code) { name capital currency }
      }
    variables:
      code: JP
  test: res.code == 200 && len(res.errors) == 0 && res.data.country.capital == "Tokyo"
  • with takes url, query, variables, operation_name, headers and timeout (default 30s). The request is a POST with a JSON body.
  • res.data and res.errors hold the data and errors of the response, and res.body the whole body. status is 0 when the status code is 2xx, the body is JSON and errors is empty.
  • Any response the server sends is a result, so a test can assert on a GraphQL error or a 500. Only a request that gets no response fails the step as an error.
  • The action keeps to no guard: under --read-only or --allow-host, a step that uses it is refused unless --allow-action names it.

Releasing

A v* tag builds the executables with GoReleaser, and the release workflow commits an action.yml with their URLs and SHA-256 digests. That commit, in the uses line above, is the one to pin.

Changelog

  • 7edaf9e Send a GraphQL query from a Probe workflow