Skip to content

Commit a522b16

Browse files
Update to 4 in STEP and README.md
1 parent 116f1b6 commit a522b16

File tree

2 files changed

+9
-36
lines changed

2 files changed

+9
-36
lines changed

.github/steps/-step.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3
1+
4

README.md

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,18 @@ _Create and run a GitHub Actions workflow._
66

77
</header>
88

9-
## Step 3: Add a step to your workflow file
9+
## Step 4: Merge your workflow file
1010

11-
_Nice work adding a job to your workflow! :dancer:_
11+
_You're now able to write and run an Actions workflow! :sparkles:_
1212

13-
Workflows have jobs, and jobs have steps. So now we'll add a step to your workflow.
13+
Merge your changes so the action will be a part of the `main` branch.
1414

15-
**What are _steps_?**: Actions steps run - in the order they are specified, from the top down - when a workflow job is processed. Each step must pass for the next step to run.
15+
### :keyboard: Activity: Merge your workflow file
1616

17-
Each step consists of either a shell script that's executed, or a reference to an action that's run. When we talk about an action (with a lowercase "a") in this context, we mean a reusable unit of code. You can find out about actions in "[Finding and customizing actions](https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions)," but for now we'll use a shell script in our workflow step.
18-
19-
Update your workflow to make it post a comment on new pull requests. It will do this using a [bash](https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) script and [GitHub CLI](https://cli.github.com/).
20-
21-
### :keyboard: Activity: Add a step to your workflow file
22-
23-
1. Still working on the `welcome-workflow` branch, open your `welcome.yml` file.
24-
1. Update the contents of the file to:
25-
26-
```yaml copy
27-
name: Post welcome comment
28-
on:
29-
pull_request:
30-
types: [opened]
31-
permissions:
32-
pull-requests: write
33-
jobs:
34-
build:
35-
name: Post welcome comment
36-
runs-on: ubuntu-latest
37-
steps:
38-
- run: gh pr comment $PR_URL --body "Welcome to the repository!"
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
PR_URL: ${{ github.event.pull_request.html_url }}
42-
```
43-
44-
**Note:** The step you've added uses GitHub CLI (`gh`) to add a comment when a pull request is opened. To allow GitHub CLI to post a comment, we set the `GITHUB_TOKEN` environment variable to the value of the `GITHUB_TOKEN` secret, which is an installation access token, created when the workflow runs. For more information, see "[Automatic token authentication](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)." We set the `PR_URL` environment variable to the URL of the newly created pull request, and we use this in the `gh` command.
45-
46-
1. Click **Commit changes** in the top right of the workflow editor.
47-
1. Type your commit message and commit your changes directly to your branch.
17+
1. In your repo, click on the **Pull requests** tab.
18+
1. Click on the pull request you created in step 1.
19+
1. Click **Merge pull request**, then click **Confirm merge**.
20+
1. Optionally, click **Delete branch** to delete your `welcome-workflow` branch.
4821
1. Wait about 20 seconds, then refresh this page (the one you're following instructions from). Another workflow will run and will replace the contents of this README file with instructions for the next step.
4922

5023
<footer>

0 commit comments

Comments
 (0)