-
Notifications
You must be signed in to change notification settings - Fork 9
75 lines (67 loc) · 3.74 KB
/
new-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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# v0.6
name: New issue
on:
issues:
types: [opened]
jobs:
issueCreated:
runs-on: ubuntu-latest
if: ${{ !github.event.issue.pull_request && !startsWith(github.event.issue.title, 'Update stable version in repo') && github.actor != 'ioBroker-Bot' }}
permissions:
issues: write
steps:
- name: Create label (not beta version)
id: create_label_version
run: gh label create not-latest-version --description "Beta version not found in issue" --color B02727 --force
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
- name: Setup node
id: setup_node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Get package name
id: get_package_name
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.event.repository.name }}
- name: Get NPM version
id: get_npm_version
run: echo "LATEST_VERSION=$(npm view ${{ steps.get_package_name.outputs.lowercase }}@latest version)" >> "$GITHUB_OUTPUT"
- name: Create comment
id: create_comment_ok
if: ${{ contains(github.event.issue.body, steps.get_npm_version.outputs.LATEST_VERSION) }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
Thanks for reporting a new issue @${{ github.actor }}!
1. Please ensure your topic is not covered in the [documentation](https://github.com/${{ github.event.repository.full_name }}/blob/v${{ steps.get_npm_version.outputs.LATEST_VERSION }}/docs/en/README.md)
2. Please attach all necessary log files (in debug mode!), screenshots and other information to reproduce this issue.
3. [Search for the issue topic](https://github.com/${{ github.event.repository.full_name }}/issues?q=is%3Aissue) in other/closed issues to avoid duplicates!
4. Check the changelog if the issue has already been covered in a previous release
*Otherwise this issue will be closed!*
- name: Create comment (not beta version)
id: create_comment_version
if: ${{ !contains(github.event.issue.body, steps.get_npm_version.outputs.LATEST_VERSION) }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
Thanks for reporting a new issue @${{ github.actor }}!
**Important:** Ensure that you use the latest available **beta version** of this adapter (not the current stable version!): **${{ steps.get_npm_version.outputs.LATEST_VERSION }}**
1. Please ensure your topic is not covered in the [documentation](https://github.com/${{ github.event.repository.full_name }}/blob/v${{ steps.get_npm_version.outputs.LATEST_VERSION }}/docs/en/README.md)
2. Please attach all necessary log files (in debug mode!), screenshots and other information to reproduce this issue.
3. [Search for the issue topic](https://github.com/${{ github.event.repository.full_name }}/issues?q=is%3Aissue) in other/closed issues to avoid duplicates!
4. Check the changelog if the issue has already been covered in a previous release
*Otherwise this issue will be closed!*
- name: Add label (not beta version)
id: add_label_version
if: ${{ !contains(github.event.issue.body, steps.get_npm_version.outputs.LATEST_VERSION) }}
run: gh issue edit "$NUMBER" --add-label not-latest-version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}