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
| Name | The name of your action. Helps visually identify the actions in a job. |:white_check_mark:|
40
+
| Description | A summary of what your action does. |:white_check_mark:|
41
+
| Inputs | Input parameters allow you to specify data that the action expects to use during runtime. These parameters become environment variables in the runner. |:x:|
42
+
| Outputs | Specifies the data that subsequent actions can use later in the workflow after the action that defines these outputs has run. |:x:|
43
+
| Runs | The command to run when the action executes. |:white_check_mark:|
44
+
| Branding | You can use a color and Feather icon to create a badge to personalize and distinguish your action in GitHub Marketplace. |:x:|
45
+
46
+
---
47
+
48
+
Read more about [Action metadata](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions)
49
+
50
+
### :keyboard: Activity 1: Create the metadata file
32
51
33
52
All of the following steps take place inside of the `.github/actions/joke-action` directory.
34
53
35
-
We will start with using the parameters that are **required** and later implement some optional parameters as our action evolves.
54
+
Our action does not require much metadata for it to run correctly. We will not be accepting any inputs, we will however be setting a single output this time.
36
55
37
-
1. Create a new file in: `.github/actions/joke-action/action.yml`
38
-
2. Add the following contents to the `.github/actions/joke-action/action.yml` file:
56
+
1. Update the action metadata file `.github/actions/joke-action/action.yml` with the following content:
39
57
40
58
```yaml
41
59
name: "my joke action"
42
60
43
61
description: "use an external API to retrieve and display a joke"
44
62
63
+
outputs:
64
+
joke-output:
65
+
description: The resulting joke from the icanhazdadjokes API
66
+
45
67
runs:
46
68
using: "node16"
47
69
main: "main.js"
48
70
```
49
71
50
-
3. Save the `action.yml` file
51
-
4. Commit the changes and push them to the `main` branch:
72
+
2. Save the `action.yml` file
73
+
3. Commit the changes and push them to GitHub:
52
74
```shell
53
75
git add action.yml
54
-
git commit -m 'create action.yml'
55
-
git pull
76
+
git pull
77
+
git commit -m 'add metadata for the joke action'
56
78
git push
57
79
```
58
-
5. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
80
+
4. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
0 commit comments