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: README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ This action has three required inputs; `labels`, `mode` and `count`
18
18
19
19
This action calls the GitHub API to fetch labels for a PR rather than reading `event.json`. This allows the action to run as intended when an earlier step adds a label. It will use `github.token` by default, and you can set the `token` input to provide alternative authentication.
20
20
21
+
If successful, any matching labels will be output in `outputs.labels` as a comma separated string.
22
+
21
23
## Examples
22
24
23
25
### Complete example
@@ -149,3 +151,30 @@ jobs:
149
151
- run: echo FAILURE && exit 1
150
152
if: needs.label.outputs.status == 'failure'
151
153
```
154
+
155
+
### Using Output Labels
156
+
157
+
If the action was successful you can access the matching labels via `outputs.labels`. This is useful if you want to use the labels in a later step.
158
+
159
+
```yaml
160
+
name: Pull Request Labels
161
+
on:
162
+
pull_request:
163
+
types: [opened, labeled, unlabeled, synchronize]
164
+
jobs:
165
+
label:
166
+
runs-on: ubuntu-latest
167
+
steps:
168
+
- id: check-labels
169
+
uses: mheap/github-action-required-labels@v4
170
+
with:
171
+
mode: minimum
172
+
count: 1
173
+
labels: "feature-1, feature-2, feature-3"
174
+
- run: |
175
+
echo "Enabled Features:"
176
+
for f in $(echo "{{steps.check-labels.outputs.labels}}" | sed "s/,/ /g")
0 commit comments