17 KiB
title, shortTitle, intro, versions, type, topics
| title | shortTitle | intro | versions | type | topics | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Using the GitHub CLI on a runner | Use the GitHub CLI on a runner | How to use advanced {% data variables.product.prodname_actions %} features for continuous integration (CI). |
|
how_to |
|
{% data reusables.actions.enterprise-github-hosted-runners %}
Example overview
{% data reusables.actions.example-workflow-intro-ci %} When this workflow is triggered, it automatically runs a script that checks whether the {% data variables.product.prodname_dotcom %} Docs site has any broken links. If any broken links are found, the workflow uses the {% data variables.product.prodname_dotcom %} CLI to create a {% data variables.product.prodname_dotcom %} issue with the details.
{% data reusables.actions.example-diagram-intro %}
Features used in this example
{% data reusables.actions.example-table-intro %}
| Feature | Implementation |
|---|---|
| {% data reusables.actions.cron-table-entry %} | |
| {% data reusables.actions.permissions-table-entry %} | |
| {% data reusables.actions.if-conditions-table-entry %} | |
| {% data reusables.actions.secrets-table-entry %} | |
| {% data reusables.actions.checkout-action-table-entry %} | |
| {% data reusables.actions.setup-node-table-entry %} | |
| Using a third-party action: | peter-evans/create-issue-from-file |
| Running shell commands on the runner: | run |
| Running a script on the runner: | Using script/check-english-links.js |
| Generating an output file: | Piping the output using the > operator |
| Checking for existing issues using {% data variables.product.prodname_cli %}: | gh issue list |
| Commenting on an issue using {% data variables.product.prodname_cli %}: | gh issue comment |
Example workflow
{% data reusables.actions.example-docs-engineering-intro %} check-all-english-links.yml.
{% data reusables.actions.note-understanding-example %}
|
Understanding the example
{% data reusables.actions.example-explanation-table-intro %}
| Code | Explanation |
|---|---|
|
{% data reusables.actions.explanation-name-key %} |
|
Defines the
|
|
Modifies the default permissions granted to |
|
Groups together all the jobs that run in the workflow file. |
|
Defines a job with the ID |
|
Only run the |
|
Configures the job to run on an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by {% data variables.product.prodname_dotcom %}. For syntax examples using other runners, see "Workflow syntax for {% data variables.product.prodname_actions %}." |
|
Creates custom environment variables, and redefines the built-in |
|
Groups together all the steps that will run as part of the |
|
The |
|
This step uses the |
|
The |
|
This |
|
If the |
|
Uses the |
|
Uses
|
|
If an issue from a previous run is open and assigned to someone, then use |
|
If an issue from a previous run is open and is not assigned to anyone, then:
|
Next steps
{% data reusables.actions.learning-actions %}
