Repository navigation
v1.24.0
Highlights
- A workflow names its external actions once, under
actions, and its steps anddefaultsuse the name. - The
dnsaction asks a DNS server for the records of a name. - Probe hides the credentials of object storage, and the password in a
url. - The external actions redis and s3 have reference pages.
- For library users:
Config.Actions,Workflow.Actions,mask.HoldsURL,mask.Userinfoandexpr.ReplaceTemplatesare new. Nothing breaks.
actions
A step that runs an external action writes its repository and a 40-character commit in uses, and a job's defaults writes them again as a key. A workflow can now write them once:
actions:
graphql: github.com/mozership/probe-graphql@41e4ffa222db58c63c7169117c919e6d252bdbf9 # v0.2.0
jobs:
- name: Countries API
defaults:
graphql:
url: https://countries.trevorblades.com/graphql
steps:
- name: Look up Japan
uses: graphql
with:
query: '{ country(code: "JP") { capital } }'
test: res.data.country.capital == "Tokyo"- A newer release of an action is a change to one line.
- A name is letters, digits,
_and-, and starts with a letter or a digit. - A name cannot be that of an action of Probe, such as
httporshell: whatuses: httpruns does not depend on the workflow. A workflow that gives such a name fails to load. - The value names an external action as
usesdoes: a repository pinned to a full commit SHA, or a local path. It is not a template, and it cannot be another name. - A step can still name an action in full, and the
defaultswritten by the name apply to it too. --allow-actiontakes the action in full, not the name: a workflow cannot choose what a name the person running Probe has allowed stands for.probe checkreports a wrong name or value with its line.- The names belong to the workflow file. A job file run by the
embeddedaction does not see them, and names its external actions in full.
See actions and Naming an External Action.
dns
A built-in action that asks a DNS server for the records of a name, and returns what the server answered: that a name resolves to the addresses expected, that the MX, SPF, DKIM and DMARC records of a mail flow are in place, or that a change to a zone has reached a name server.
- name: Where the mail of example.com goes
uses: dns
with:
name: example.com
type: MX
test: res.rcode == "NOERROR" && res.answers[0].host == "mail.example.com"
- name: ns1 serves the new address
uses: dns
with:
name: api.example.com
server: ns1.example.com
test: res.authoritative && res.values == ["203.0.113.10"]typeisAby default, and any type DNS has butAXFRandIXFR. Withtype: PTR,namemay be an address.serveris the server to ask, and the resolvers of the machine without it.protocolisudp,tcp, ortlsfor DNS over TLS. An answer cut short over UDP is asked for again over TCP.res.answersholds the records, each withname,type,ttlanddata, and the parts of anMX,SRV,SOAorCAAby name.res.valuesholds thedataof the answers of the type asked for.- A server that answers with an error, such as
NXDOMAIN, is a result a test can check, withstatus1. - A query writes nothing, so the action runs under
--read-only. Under--allow-host, the server asked must be one the run allows.
See DNS.
Credentials passed to an action
Probe showed the value of a password or key_passphrase field of with, and the password in a dsn, as <redacted>. It now does so for more:
- The value of a
secret_access_keyorsession_tokenfield, at any depth ofwith. - The password in a
url, such asredis://user:password@host. The rest of the URL stays visible. - When a template in the user info of a
urlcannot be evaluated, as inredis://app:{{vars.pw}}@host, the error names the value but does not say why, since the template and the error may each quote the password. The error of a template elsewhere in aurlis shown.
A credential written straight into a step therefore does not appear in --verbose output or an action's log records, even when it is not listed in secrets. See secrets.
redis and s3 have reference pages
Two external actions are new, each at v0.1.0, with a reference page in English and Japanese that probe guide redis and probe guide s3 print.
- mozership/probe-redis runs commands on a Redis or Valkey server and returns their replies. See Redis.
- mozership/probe-s3 reads and writes objects in S3 and in storage that speaks its protocol. See S3.
actions:
redis: github.com/mozership/probe-redis@7d60e0699a914e3c987ed5f2403ed8a7f3d176fa # v0.1.0
s3: github.com/mozership/probe-s3@8d2a120ffe6f2860229f5b6171a3477ed0f07b6d # v0.1.0Both declare guard: [read-only, allow-host], so they run under a guard without --allow-action.
For library users
Nothing breaks in this release. New public API:
Workflow.Actions, the names a workflow gives its external actions.Loadreplaces each name by its action, so aStep.Usesread after it is the action in full.Config.Actions, the names of the built-in actions, which a name underactionsmust not be. With none given, a clash is not checked.mask.HoldsURL(key)andmask.Userinfo(rawURL), which tell a key whose value is a URL and find the user info of one.expr.ReplaceTemplates(s, repl), which returnsswithreplin place of each template.
github.com/miekg/dns is a new dependency, for the dns action.
Changelog
- ac92463 Add the dns action, which asks a DNS server for the records of a name
- a01e0a1 Document redis and s3 as external actions
- 011ef0d Hide the credentials of object storage, and the password in a url
- 159f5fb Hide why a template in the user info of a url could not be evaluated
- 11773a6 Let a workflow name its external actions under actions
- 577e652 Merge pull request #365 from mozership/feat/dns-action
- 78a3f2e Merge pull request #366 from mozership/fix/mask-action-credentials
- d1f8fdd Merge pull request #367 from mozership/feat/action-aliases
- f6829a0 Merge pull request #368 from mozership/docs/redis-s3-actions
- 45df550 Refuse a template in the action a name stands for