This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (42 loc) · 2.03 KB
/
new-firmware-request-issue.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
name: Update new firmware request issue
on:
issues:
types:
- opened
env:
LABEL_COLOR: "#D9B245"
jobs:
process-new-issue:
name: Process new issue
runs-on: ubuntu-22.04
if: "contains(github.event.issue.labels.*.name, 'new firmware')"
permissions:
issues: write
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
- name: Get fields from issue
id: issue-fields
run: |
echo "${{github.event.issue.body}}" | python ci/get_fields_from_new_firmware_issue.py >> $GITHUB_OUTPUT
- name: Tag the issue
run: |
LABEL_NAME="device: ${{ steps.issue-fields.outputs.device }}"
gh label create "${LABEL_NAME}" --force --color "${LABEL_COLOR}" --description "Firmware request for ${{ steps.issue-fields.outputs.device }}"
gh issue edit ${{ github.event.issue.number }} --add-label "device: ${{ steps.issue-fields.outputs.device }}"
- name: Fix the issue title
run: |
gh issue edit ${{ github.event.issue.number }} --title "[FIRMWARE REQUEST]: ${{ steps.issue-fields.outputs.device }} ${{ steps.issue-fields.outputs.firmware_version }}"
- name: Check firmware is definitely not supported already
run: |
if [ -d "./devices/${{ steps.issue-fields.outputs.device }}/${{ steps.issue-fields.outputs.firmware_version }}" ]; then
gh issue comment ${{ github.event.issue.number }} -b "It appears that this firmware may already be supported. If this is incorrect, please reopen the issue!"
gh issue edit ${{ github.event.issue.number }} --add-label "duplicate"
gh issue close ${{ github.event.issue.number }}
exit 1
fi
- name: Comment with GPL Archive Request email body
run: |
COMMENT_BODY="$(python ci/render_request_email_issue_comment.py "${{ steps.issue-fields.outputs.device }}" "${{ steps.issue-fields.outputs.firmware_version }}")"
gh issue comment ${{ github.event.issue.number }} -b "${COMMENT_BODY}"