Skip to content

Commit

Permalink
wip: Add workflow for adding instance flavor label based on issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfr committed Mar 28, 2024
1 parent 1badcae commit 58990a5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/request-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Instance Request Labeler"
on:
issues:
types:
- reopened
- opened

permissions:
issues: write
contents: read

jobs:
labeler:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'instance:requested')
steps:
- name: Issue Forms Body Parser
id: parse
uses: zentered/[email protected]

- name: Extract issue fields
id: extract
run: |
instance_flavor = ${{ toJSON(steps.parse.outputs.data) }} | \
jq .instance-flavor.text
echo "instance_flavor [$instance_flavor]"
echo "instance_flavor=$instance_flavor" >> $GITHUB_OUTPUT
- name: Add flavor label
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: flavor:${{ steps.extract.outputs.instance_flavor }}

0 comments on commit 58990a5

Please sign in to comment.