Skip to content

Commit 754c751

Browse files
committed
Document how to schedule tests via @openqa: in a GHA
And mention that comments require API access. See: https://progress.opensuse.org/issues/191635
1 parent 6bd1da8 commit 754c751

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

docs/WritingTests.asciidoc

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,11 +2330,31 @@ feature is explained in further detail in the corresponding
23302330
<<UsersGuide.asciidoc#scenarios_yaml,users guide section>>.
23312331

23322332
It is also possible to create a GitHub workflow that will clone and monitor an
2333-
openQA job which is mentioned in the PR description or comment. The scripts
2334-
repository contains a pre-defined GitHub action for this. Checkout the
2335-
documentation of the
2336-
https://github.com/os-autoinst/os-autoinst-scripts/blob/master/openqa-clone-and-monitor-job-from-pr[openqa-clone-and-monitor-job-from-pr]
2337-
script for further information and an example configuration.
2333+
openQA job which is mentioned in the PR description using https://github.com/os-autoinst/os-autoinst-scripts/blob/master/openqa-clone-and-monitor-job-from-pr[openqa-clone-and-monitor-job-from-pr] with something like this:
2334+
2335+
----
2336+
name: Schedule openQA tests mentioned via @openqa:
2337+
on:
2338+
pull_request_target:
2339+
workflow_dispatch:
2340+
env:
2341+
OPENQA_HOST: ${{ secrets.OPENQA_URL }}
2342+
OPENQA_API_KEY: ${{ secrets.OPENQA_API_KEY }}
2343+
OPENQA_API_SECRET: ${{ secrets.OPENQA_API_SECRET }}
2344+
GH_REPO: ${{ github.event.pull_request.head.repo.full_name }}
2345+
GH_REF: ${{ github.event.pull_request.head.ref }}
2346+
GH_PR_BODY: ${{ github.event.pull_request.body }}
2347+
jobs:
2348+
clone_and_monitor_job_from_pr:
2349+
runs-on: ubuntu-latest
2350+
container:
2351+
image: registry.opensuse.org/devel/openqa/containers/tumbleweed:client
2352+
steps:
2353+
- uses: os-autoinst/os-autoinst-scripts/actions/clone-job@master
2354+
----
2355+
2356+
In this example the body of the PR is passed via `GH_PR_BODY`. Comments can also
2357+
be provided but this requires use of the GitHub API via the comments endpoint.
23382358

23392359
NOTE: These examples show how API credentials are supplied. It is important to
23402360
note that using `on:pull_request` would only work for PRs created on the main

0 commit comments

Comments
 (0)