Skip to content

Commit b66e90a

Browse files
authored
Merge pull request #17 from camihmerhar/Infomagnus-SubOD-3.1.2-3.1.5
commit fixes
2 parents 5f6ba54 + 5d5f3fc commit b66e90a

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

learn-pr/github/create-custom-github-actions/includes/create-custom-github-action.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ GitHub Actions is a powerful feature that helps you to go from code to cloud, al
22

33
## Types of GitHub actions
44

5-
![alt text](../media/action-types.png)
5+
:::image type="content" source="../media/action-types.png" alt-text="Diagram that displays the three types of GitHub Actions; Docker, JavaScript, and composite run steps actions." border="false":::
66

77
Actions are individual tasks that you can use to customize your development workflows. You can create your own actions by writing custom code that interacts with your repository to perform custom tasks, or by using actions the GitHub community shares. Navigating through various actions, you'll notice that there are three different types of actions: _Docker container actions_, _JavaScript actions_, and _composite run steps actions_. Let's take a closer look at each action type.
88

@@ -137,7 +137,8 @@ jobs:
137137
| **Test Before Publishing** | Validate the composite action in a test repository. |
138138

139139
## Composite Action in a Workflow
140-
![alt text](../media/composite-action-workflow.png)
140+
141+
Composite actions are a powerful way to simplify workflows by bundling multiple steps into a reusable unit. These actions allow you to define a sequence of commands or actions in a single `action.yml` file, making it easier to maintain and reuse logic across workflows.
141142

142143
## Benefits of Composite Actions:
143144
- **Reusability** - Define actions once and use them in multiple workflows.
@@ -232,10 +233,8 @@ async function run() {
232233

233234
run();
234235
```
235-
**Explanation:**
236-
Uses core.getInput() to get the CLI version input.
237-
Runs a curl command to download and install the CLI.
238-
Uses core.setFailed() to fail the workflow if the installation fails.
236+
**Explanation:**
237+
The JavaScript action uses `core.getInput()` to retrieve the CLI version specified as input. It then executes a `curl` command to download and install the CLI. If the installation process fails, the action uses `core.setFailed()` to mark the workflow as failed.
239238

240239
### Step 4: Test the Action Locally
241240
Before using the action in a workflow, test it on a GitHub-hosted runner.
@@ -338,18 +337,19 @@ ACTIONS_RUNNER_DEBUG=true
338337

339338
### How to Set Secrets for Debugging
340339
1. Go to your GitHub repository.
341-
2. Navigate to Settings > Secrets and variables > Actions.
342-
3.Add new secrets named:
343-
. ACTIONS_STEP_DEBUG → true
344-
. ACTIONS_RUNNER_DEBUG → true
340+
2. Navigate to **Settings** > **Secrets and variables** > **Actions**.
341+
3. Add new secrets with the following names and values:
342+
- **ACTIONS_STEP_DEBUG**: `true`
343+
- **ACTIONS_RUNNER_DEBUG**: `true`
344+
345345

346346
### Inspect Workflow Logs
347347
When a workflow fails, click on the failed job in the Actions tab. Expand each step to:
348348

349-
. View detailed logs
350-
. Check standard output (stdout)
351-
. See the exit code of scripts
352-
. Identify unhandled exceptions
349+
- View detailed logs
350+
- Check standard output (stdout)
351+
- See the exit code of scripts
352+
- Identify unhandled exceptions
353353

354354
🔍 Example Log Output
355355
```plaintext
@@ -379,11 +379,6 @@ try {
379379
```
380380
🔁 This ensures GitHub stops the workflow on error and provides readable logs.
381381

382-
### Failure and Troubleshoot workflow
383-
384-
![alt text](../media/github-workflow-failure-debug-flow.png)
385-
386-
387382
### Best Practices for Debugging JavaScript Actions
388383
| **Practice** | **Description** |
389384
|--------------------------|------------------------------------------------------------------------------|
Binary file not shown.

0 commit comments

Comments
 (0)