You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Catch the error & report it using a curl to GitHub’s API. An example like this should work: curl -H "Authorization: token $GHTOKEN" -X POST -d '{"state": "failure", "context": "Custom Check"}' https://api.github.com/repos/$TUGBOAT_GITHUB_OWNER/$TUGBOAT_GITHUB_REPO/statuses/$TUGBOAT_PREVIEW_SHA
Where $GHTOKEN is an environment variable you define on the Tugboat repo with a GitHub API token.
If tests are done with a single command, this example should work:
For reference this is the online phase YAML I use to get Drupal 9 PHPUnit tests running on Tugboat and reporting back to GitHub. This also includes setting the status as "pending" before the test run.
A Tugboat user in the Support Slack asked about creating a custom PR status for running PHPUnit functional tests in the
online
phase.@bchavet suggested this:
Catch the error & report it using a curl to GitHub’s API. An example like this should work:
curl -H "Authorization: token $GHTOKEN" -X POST -d '{"state": "failure", "context": "Custom Check"}' https://api.github.com/repos/$TUGBOAT_GITHUB_OWNER/$TUGBOAT_GITHUB_REPO/statuses/$TUGBOAT_PREVIEW_SHA
Where
$GHTOKEN
is an environment variable you define on the Tugboat repo with a GitHub API token.If tests are done with a single command, this example should work:
your-command-here && \ curl -H "Authorization: token $GHTOKEN" -X POST -d '{"state": "success", "context": "Custom Check"}' \ https://api.github.com/repos/$TUGBOAT_GITHUB_OWNER/$TUGBOAT_GITHUB_REPO/statuses/$TUGBOAT_PREVIEW_SHA || \ curl -H "Authorization: token $GHTOKEN" -X POST -d '{"state": "failure", "context": "Custom Check"}' \ https://api.github.com/repos/$TUGBOAT_GITHUB_OWNER/$TUGBOAT_GITHUB_REPO/statuses/$TUGBOAT_PREVIEW_SHA
Ben pulled the info for this from these resources:
The text was updated successfully, but these errors were encountered: