Skip to content

Commit 58990a5

Browse files
committed
wip: Add workflow for adding instance flavor label based on issue
1 parent 1badcae commit 58990a5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/request-labeler.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Instance Request Labeler"
2+
on:
3+
issues:
4+
types:
5+
- reopened
6+
- opened
7+
8+
permissions:
9+
issues: write
10+
contents: read
11+
12+
jobs:
13+
labeler:
14+
runs-on: ubuntu-latest
15+
if: contains(github.event.pull_request.labels.*.name, 'instance:requested')
16+
steps:
17+
- name: Issue Forms Body Parser
18+
id: parse
19+
uses: zentered/[email protected]
20+
21+
- name: Extract issue fields
22+
id: extract
23+
run: |
24+
instance_flavor = ${{ toJSON(steps.parse.outputs.data) }} | \
25+
jq .instance-flavor.text
26+
echo "instance_flavor [$instance_flavor]"
27+
echo "instance_flavor=$instance_flavor" >> $GITHUB_OUTPUT
28+
29+
- name: Add flavor label
30+
run: gh issue edit "$NUMBER" --add-label "$LABELS"
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GH_REPO: ${{ github.repository }}
34+
NUMBER: ${{ github.event.issue.number }}
35+
LABELS: flavor:${{ steps.extract.outputs.instance_flavor }}

0 commit comments

Comments
 (0)