-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
56 lines (53 loc) · 1.77 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: "GitHub Projects Set Select Option"
description: "Sets the value of a select list based on the text value."
branding:
icon: search
color: orange
inputs:
token:
description: "Token to access the project via API"
required: true
project-number:
description: "Number of the project"
required: true
project-owner:
description: "The owner of the project. This is normally an organization."
required: true
item-id:
description: "The Id of the item which should be edited."
required: true
field-name:
description: "The name of the select field."
required: true
select-option-name:
description: "The Name for the option of the select field. It has to be an existing value."
required: true
runs:
using: "composite"
steps:
- name: Get field ids
id: get-field-ids
uses: infinite-automations/[email protected]
with:
token: ${{ inputs.token }}
project-number: ${{ inputs.project-number }}
project-owner: ${{ inputs.project-owner }}
field-name: ${{ inputs.field-name }}
select-option-name: ${{ inputs.select-option-name }}
- name: Set Select field value
id: set-select-field-alue
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}
run: |
project_id=$(\
gh project list \
--owner ${{ inputs.project-owner }} \
--format json \
--limit 1000 \
--jq '.projects[] | select(.number == ${{ inputs.project-number }}) .id')
gh project item-edit \
--id ${{ inputs.item-id }} \
--project-id $project_id \
--field-id ${{ steps.get-field-ids.outputs.field-id }} \
--single-select-option-id ${{ steps.get-field-ids.outputs.select-option-id }}