Skip to content

Commit 2a2df19

Browse files
Martin Lopeslucascosti
andauthored
Update the GitHub Actions Quickstart (github#18294)
* Revised quickstart example, added screenshots * Updated example * Updated result and example * Slight re-wording * Added explanations for each action * Removed superfluous bits * Update actions-quickstart-workflow-sidebar.png * Update actions-quickstart-job.png * Update actions-quickstart-job.png * Update actions-quickstart-job.png * Update quickstart.md * Apply suggestions from code review Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com> * Apply suggestions from code review * Added details about ls action Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
1 parent ede2539 commit 2a2df19

7 files changed

+41
-103
lines changed
Loading
Loading
Loading
Loading
Loading
Loading

content/actions/quickstart.md

Lines changed: 41 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Quickstart for GitHub Actions
3-
intro: 'Add a {% data variables.product.prodname_actions %} workflow to an existing repository in 5 minutes or less.'
3+
intro: 'Try out the features of {% data variables.product.prodname_actions %} in 5 minutes or less.'
44
allowTitleToDifferFromFilename: true
55
redirect_from:
66
- /actions/getting-started-with-github-actions/starting-with-preconfigured-workflow-templates
@@ -19,135 +19,73 @@ topics:
1919

2020
### Introduction
2121

22-
You only need an existing {% data variables.product.prodname_dotcom %} repository to create and run a {% data variables.product.prodname_actions %} workflow. In this guide, you'll add a workflow that lints multiple coding languages using the [{% data variables.product.prodname_dotcom %} Super-Linter action](https://github.com/github/super-linter). The workflow uses Super-Linter to validate your source code every time a new commit is pushed to your repository.
22+
You only need a {% data variables.product.prodname_dotcom %} repository to create and run a {% data variables.product.prodname_actions %} workflow. In this guide, you'll add a workflow that demonstrates some of the essential features of {% data variables.product.prodname_actions %}.
23+
24+
The following example shows you how {% data variables.product.prodname_actions %} jobs can be automatically triggered, where they run, and how they can interact with the code in your repository.
2325

2426
### Creating your first workflow
2527

26-
1. From your repository on {% data variables.product.prodname_dotcom %}, create a new file in the `.github/workflows` directory named `superlinter.yml`. For more information, see "[Creating new files](/github/managing-files-in-a-repository/creating-new-files)."
27-
2. Copy the following YAML contents into the `superlinter.yml` file. **Note:** If your default branch is not `main`, update the value of `DEFAULT_BRANCH` to match your repository's default branch name.
28+
1. From your repository on {% data variables.product.prodname_dotcom %}, create a new file in the `.github/workflows` directory named `github-actions-demo.yml`. For more information, see "[Creating new files](/github/managing-files-in-a-repository/creating-new-files)."
29+
2. Copy the following YAML contents into the `github-actions-demo.yml` file:
2830
{% raw %}
2931
```yaml{:copy}
30-
name: Super-Linter
31-
32-
# Run this workflow every time a new commit pushed to your repository
33-
on: push
34-
32+
name: GitHub Actions Demo
33+
on: [push]
3534
jobs:
36-
# Set the job key. The key is displayed as the job name
37-
# when a job name is not provided
38-
super-lint:
39-
# Name the Job
40-
name: Lint code base
41-
# Set the type of machine to run on
35+
Explore-GitHub-Actions:
4236
runs-on: ubuntu-latest
43-
4437
steps:
45-
# Checks out a copy of your repository on the ubuntu-latest machine
46-
- name: Checkout code
38+
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
39+
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
40+
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
41+
- name: Check out repository code
4742
uses: actions/checkout@v2
43+
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
44+
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
45+
- name: List files in the repository
46+
run: |
47+
ls ${{ github.workspace }}
48+
- run: echo "🍏 This job's status is ${{ job.status }}."
4849
49-
# Runs the Super-Linter action
50-
- name: Run Super-Linter
51-
uses: github/super-linter@v3
52-
env:
53-
DEFAULT_BRANCH: main
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5550
```
5651
{% endraw %}
57-
3. To run your workflow, scroll to the bottom of the page and select **Create a new branch for this commit and start a pull request**. Then, to create a pull request, click **Propose new file**.
58-
![Commit workflow file](/assets/images/commit-workflow-file.png)
52+
3. Scroll to the bottom of the page and select **Create a new branch for this commit and start a pull request**. Then, to create a pull request, click **Propose new file**.
53+
![Commit workflow file](/assets/images/help/repository/actions-quickstart-commit-new-file.png)
5954
60-
Committing the workflow file in your repository triggers the `push` event and runs your workflow.
55+
Committing the workflow file to a branch in your repository triggers the `push` event and runs your workflow.
6156
6257
### Viewing your workflow results
6358
6459
{% data reusables.repositories.navigate-to-repo %}
6560
{% data reusables.repositories.actions-tab %}
66-
{% data reusables.repositories.navigate-to-workflow-superlinter %}
67-
{% data reusables.repositories.view-run-superlinter %}
68-
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" or currentVersion == "github-ae@latest" %}
69-
1. Under **Jobs** or in the visualization graph, click the **Lint code base** job.
70-
![Lint code base job](/assets/images/help/repository/superlinter-lint-code-base-job-updated.png)
71-
{% else %}
72-
1. In the left sidebar, click the **Lint code base** job.
73-
![Lint code base job](/assets/images/help/repository/superlinter-lint-code-base-job.png)
74-
{% endif %}
75-
{% data reusables.repositories.view-failed-job-results-superlinter %}
76-
77-
### More workflow templates
78-
79-
{% data reusables.actions.workflow-template-overview %}
80-
81-
### Next steps
82-
83-
The super-linter workflow you just added runs each time code is pushed to your repository to help you spot errors and inconsistencies in your code. But this is only the beginning of what you can do with {% data variables.product.prodname_actions %}. Your repository can contain multiple workflows that trigger different jobs based on different events. {% data variables.product.prodname_actions %} can help you automate nearly every aspect of your application development processes. Ready to get started? Here are some helpful resources for taking your next steps with {% data variables.product.prodname_actions %}:
84-
85-
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)" for an in-depth tutorial
86-
- "[Guides](/actions/guides)" for specific uses cases and examples
87-
- [github/super-linter](https://github.com/github/super-linter) for more details about configuring the Super-Linter action
88-
89-
<div id="quickstart-treatment" hidden>
90-
91-
### Introduction
61+
1. In the left sidebar, click the workflow you want to see.
9262
93-
Printing "Hello, World!" is a great way to explore the basic set up and syntax of a new programming language. In this guide, you'll use GitHub Actions to print "Hello, World!" within your {% data variables.product.prodname_dotcom %} repository's workflow logs. All you need to get started is a {% data variables.product.prodname_dotcom %} repository where you feel comfortable creating and running a sample {% data variables.product.prodname_actions %} workflow. Feel free to create a new repository for this Quickstart to test this and future {% data variables.product.prodname_actions %} workflows.
63+
![Workflow list in left sidebar](/assets/images/help/repository/actions-quickstart-workflow-sidebar.png)
64+
1. From the list of workflow runs, click the name of the run you want to see.
9465
95-
### Creating your first workflow
66+
![Name of workflow run](/assets/images/help/repository/actions-quickstart-run-name.png)
67+
1. Under **Jobs** , click the **Explore-GitHub-Actions** job.
9668
97-
1. From your repository on {% data variables.product.prodname_dotcom %}, create a new file in the `.github/workflows` directory named `hello-world.yml`. For more information, see "[Creating new files](/github/managing-files-in-a-repository/creating-new-files)."
98-
2. Copy the following YAML contents into the `hello-world.yml` file.
99-
{% raw %}
100-
```yaml{:copy}
101-
name: Say hello!
102-
103-
# GitHub Actions Workflows are automatically triggered by GitHub events
104-
on:
105-
# For this workflow, we're using the workflow_dispatch event which is triggered when the user clicks Run workflow in the GitHub Actions UI
106-
workflow_dispatch:
107-
# The workflow_dispatch event accepts optional inputs so you can customize the behavior of the workflow
108-
inputs:
109-
name:
110-
description: 'Person to greet'
111-
required: true
112-
default: 'World'
113-
# When the event is triggered, GitHub Actions will run the jobs indicated
114-
jobs:
115-
say_hello:
116-
# Uses a ubuntu-latest runner to complete the requested steps
117-
runs-on: ubuntu-latest
118-
steps:
119-
- run: |
120-
echo "Hello ${{ github.event.inputs.name }}!"
121-
```
122-
{% endraw %}
123-
3. Scroll to the bottom of the page and select **Create a new branch for this commit and start a pull request**. Then, to create a pull request, click **Propose new file**.
124-
![Commit workflow file](/assets/images/help/repository/commit-hello-world-file.png)
125-
4. Once the pull request has been merged, you'll be ready to move on to "Trigger your workflow".
126-
127-
### Trigger your workflow
128-
129-
{% data reusables.repositories.navigate-to-repo %}
130-
{% data reusables.repositories.actions-tab %}
131-
1. In the left sidebar, click the workflow you want to run.
132-
![Select say hello job](/assets/images/help/repository/say-hello-job.png)
133-
1. On the right, click the **Run workflow** drop-down and click **Run workflow**. Optionally, you can enter a custom message into the "Person to greet" input before running the workflow.
134-
![Trigger the manual workflow](/assets/images/help/repository/manual-workflow-trigger.png)
135-
1. The workflow run will appear at the top of the list of "Say hello!" workflow runs. Click "Say hello!" to see the result of the workflow run.
136-
![Workflow run result listing](/assets/images/help/repository/workflow-run-listing.png)
137-
1. In the left sidebar, click the "say_hello" job.
138-
![Workflow job listing](/assets/images/help/repository/workflow-job-listing.png)
139-
1. In the workflow logs, expand the 'Run echo "Hello World!"' section.
140-
![Workflow detail](/assets/images/help/repository/workflow-log-listing.png)
69+
![Locate job](/assets/images/help/repository/actions-quickstart-job.png)
70+
1. The log shows you how each of the steps was processed. Expand any of the steps to view its details.
14171
72+
![Example workflow results](/assets/images/help/repository/actions-quickstart-logs.png)
73+
74+
For example, you can see the list of files in your repository:
75+
![Example action detail](/assets/images/help/repository/actions-quickstart-log-detail.png)
76+
14277
### More workflow templates
14378
14479
{% data reusables.actions.workflow-template-overview %}
14580
14681
### Next steps
14782
148-
The hello-world workflow you just added is a minimal example of a manually triggered workflow. This is only the beginning of what you can do with {% data variables.product.prodname_actions %}. Your repository can contain multiple workflows that trigger different jobs based on different events. {% data variables.product.prodname_actions %} can help you automate nearly every aspect of your application development processes. Ready to get started? Here are some helpful resources for taking your next steps with {% data variables.product.prodname_actions %}:
83+
The example workflow you just added runs each time code is pushed to the branch, and shows you how {% data variables.product.prodname_actions %} can work with the contents of your repository. But this is only the beginning of what you can do with {% data variables.product.prodname_actions %}:
84+
85+
- Your repository can contain multiple workflows that trigger different jobs based on different events.
86+
- You can use a workflow to install software testing apps and have them automatically test your code on {% data variables.product.prodname_dotcom %}'s runners.
14987
150-
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)" for an in-depth tutorial
151-
- "[Guides](/actions/guides)" for specific uses cases and examples
88+
{% data variables.product.prodname_actions %} can help you automate nearly every aspect of your application development processes. Ready to get started? Here are some helpful resources for taking your next steps with {% data variables.product.prodname_actions %}:
15289
153-
</div>
90+
- "[Learn {% data variables.product.prodname_actions %}](/actions/learn-github-actions)" for an in-depth tutorial.
91+
- "[Guides](/actions/guides)" for specific uses cases and examples.

0 commit comments

Comments
 (0)