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
Copy file name to clipboardExpand all lines: learn-pr/github/github-actions-ci/includes/2-github-actions-workflows-ci.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,29 +131,29 @@ Understanding what triggered a GitHub Actions workflow—whether it was a push t
131
131
132
132
### What is a workflow trigger?
133
133
A workflow trigger is an event that causes a workflow to start. GitHub supports various types of triggers, including:
134
-
- push or pull_request (based on code changes)
135
-
- workflow_dispatch (manual trigger)
134
+
- `push`or `pull_request` (based on code changes)
135
+
- `workflow_dispatch`(manual trigger)
136
136
- schedule (cron jobs)
137
-
- repository_dispatch (external systems)
137
+
- `repository_dispatch`(external systems)
138
138
- Issue, discussion, and PR events (e.g., issues.opened, pull_request.closed)
139
139
140
140
### Where to identify the trigger event?
141
-
You can identify the trigger event in several ways:
141
+
You can identify the trigger event in several ways:
142
142
143
-
1. From the GitHub Actions UI
143
+
1. From the GitHub Actions UI
144
144
- Navigate to the Actions tab in your repository.
145
145
- Click on a workflow run.
146
-
- The event type (e.g., push, pull_request, workflow_dispatch) is displayed at the top of the workflow run summary.
146
+
- The event type (e.g., `push`, `pull_request`, `workflow_dispatch`) is displayed at the top of the workflow run summary.
147
147
148
-
2. Using github.event_name in Logs or workflow
148
+
2. Using github.event_name in Logs or workflow
149
149
- GitHub exposes context data during a workflow run. The github.event_name variable tells you which event triggered the workflow.
150
150
- You can print it in a step for debugging:
151
151
152
152
```yml
153
153
-name: Show event trigger
154
154
run: echo "Triggered by ${{ github.event_name }}"
155
155
```
156
-
3. Using workflow Run details
156
+
3. Using workflow Run details
157
157
- If you're inspecting workflow runs programmatically (e.g., via the API), the run object includes an event property that specifies the trigger.
158
158
- You can also find the commit SHA, actor, and timestamp to trace what caused the trigger.
159
159
@@ -183,7 +183,7 @@ These practices help with debugging, auditing, and improving workflow reliabilit
183
183
To describe a workflow's effects from reading its configuration file, you need to analyze the structure and contents of the ".yml" file stored in .github/workflows/. This file outlines when the workflow runs, what it does, and how it behaves under different conditions.
184
184
185
185
### Interpret a workflow's effects:
186
-
1. Identify the trigger (on:)
186
+
1. Identify the trigger (on:)
187
187
This section tells you when the workflow is initiated. For example:
188
188
```yml
189
189
on:
@@ -198,7 +198,7 @@ Effect:
198
198
- Runs when a pull request is created or updated.
199
199
- Can also be triggered manually by a user
200
200
201
-
2. Understand the jobs and steps (jobs:)
201
+
2. Understand the jobs and steps (jobs:)
202
202
Jobs describe what the workflow will do. For instance:
203
203
```yml
204
204
jobs:
@@ -218,11 +218,11 @@ Effect:
218
218
- Installs project dependencies.
219
219
- Runs automated tests.
220
220
221
-
3. Evaluate the purpose and outcome
221
+
3. Evaluate the purpose and outcome
222
222
- By reading the configuration, you can describe the intended outcome of the workflow:
223
223
“This workflow is a Continuous Integration (CI) pipeline. It ensures that any new code pushed to the repository or submitted via pull request is automatically tested. If tests fail, the workflow will indicate this in the GitHub UI, helping maintain code quality.”
224
224
225
-
4. Optional features affecting behavior
225
+
4. Optional features affecting behavior
226
226
- env: sets environment variables.
227
227
- if: adds conditional logic to run certain steps only when criteria are met.
228
228
- timeout-minutes: or continue-on-error: influence execution behavior and error handling.
@@ -276,8 +276,7 @@ If this step failed, check:
276
276
### 1. Go to the repository
277
277
Navigate to the repository that contains the workflow.
278
278
### 2. Click on the Actions tab
279
-
- Located in the top navigation bar of the repo.
280
-
- This shows a history of all workflow runs for that repository.
279
+
Navigate to Actions tab located in the top navigation bar of the repo. This tab shows a history of all workflow runs for that repository.
281
280
282
281
### 3. Select the workflow name
283
282
- Choose the relevant workflow from the list.
@@ -290,7 +289,7 @@ You'll see a link named CI Workflow in the list.
290
289
- You’ll see a list of runs with status indicators
291
290
- Click on the timestamp or commit message of the specific run you want to inspect.
292
291
293
-
### 5. Expand each job and step
292
+
### 5. Expand each job and step
294
293
- The run summary page displays jobs as defined in the workflow file (e.g., build, test).
0 commit comments