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
* Each step consists of either a shell script that is executed, or a reference to an action that is run. When we talk about an action in this context, we mean a reusable unit of code.
4
-
* An action is a pre-defined, reusable set of jobs or code that perform specific tasks within a workflow.
4
+
* An action is a pre-defined, reusable set of jobs or code that perform specific tasks within a workflow.
5
+
6
+
### Example of workflow
7
+
_//The name of this workflow_
8
+
name: Post welcome comment
9
+
_//Trigger this workflow only when a PR is opened (not edited or closed)_
10
+
on:
11
+
pull_request:
12
+
types: [opened]
13
+
_//The workflow needs write permissions to comment on pull requests._
14
+
permissions:
15
+
pull-requests: write
16
+
_//Define a job called "build". The name could be anything. It is just a label._
17
+
jobs:
18
+
build:
19
+
name: Post welcome comment
20
+
_//The runner (virtual machine) will be Ubuntu Linux._
21
+
runs-on: ubuntu-latest
22
+
_//The steps inside the job._
23
+
steps:
24
+
_//This step runs a command that posts a comment saying "Welcome to the repository!"_
25
+
- run: gh pr comment $PR_URL --body "Welcome to the repository!"
26
+
_//The below setting sets environment variables_
27
+
env:
28
+
_//A token that allows the GitHub CLI to authenticate_
29
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+
_//The URL of the pull request that triggered the event._
0 commit comments