Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/label-commenter-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
labels:
- name: "invalid"
labeled:
issue:
body: |
This issue has been closed because you did not provide the requested information.
action: "close"
- name: "support"
labeled:
issue:
body: |
This issue has been closed as we only track bugs here.

You can get community support on [forums](https://forum.glpi-project.org/) or you can consider [taking a subscription](https://glpi-project.org/subscriptions/) to get professional support.
You can also [contact GLPI editor team](https://glpi-project.org/contact_us/) directly.
action: "close"
- name: "feature suggestion"
labeled:
issue:
body: |
This issue has been closed as we only track bugs here.

You can open a topic to discuss with community about this enhancement on [suggestion website](https://suggest.glpi-project.org).
You can also [contact GLPI editor team](https://glpi-project.org/contact_us/) directly if you are willing to sponsor this feature.
action: "close"
- name: "not reproducible"
labeled:
issue:
body: |
This issue has been closed because we could not reproduce it on the latest release.

Feel free to reopen it with the exact steps to reproduce it on the latest release.
action: "close"
- name: "security report"
labeled:
issue:
body: |
This issue has been closed because security problems must not be reported publicly.

Please edit it to remove the vulnerability details, then report it privately as described in our [security policy](https://github.com/pluginsGLPI/.github/blob/main/SECURITY.md).
action: "close"
52 changes: 52 additions & 0 deletions .github/workflows/close_stale_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Close stale issues and pull requests"

on:
schedule:
- cron: "0 8 * * *"

jobs:
stale:
if: github.repository == 'pluginsGLPI/empty'
permissions:
issues: "write" # for actions/stale to close stale issues
pull-requests: "write" # for actions/stale to close stale pull requests
runs-on: "ubuntu-latest"
steps:
- uses: "actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93" # v11.0.0
with:
stale-issue-message: >-
There has been no activity on this issue for 60 days and therefore it is considered stale
and will be closed automatically in 14 days.


If this issue is related to a bug, please try to reproduce on latest release. If the problem persists,
feel free to add a comment to revive this issue.
stale-pr-message: >-
There has been no activity on this pull request for 90 days and therefore it is considered stale
and will be closed automatically in 14 days.
Feel free to add a comment or push new commits to keep it open.
days-before-issue-stale: 60
days-before-pr-stale: 90
days-before-close: 14
exempt-issue-labels: "bug,enhancement,question,security,need feedback" # Issues with "bug", "enhancement", "question" or "security" labels will not be marked as stale, "need feedback" ones are handled by the next step
exempt-pr-labels: "security" # PR with "security" label will not be marked as stale
exempt-draft-pr: true # Draft PR are work in progress.
exempt-all-milestones: true # Do not check issues/PR with defined milestone.
ascending: true # First check older issues/PR.
operations-per-run: 750 # Max API calls per run.
# Shares the "_state" cache of the step above, harmless as long as each run processes every issue
- uses: "actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93" # v11.0.0
with:
only-labels: "need feedback"
stale-issue-message: >-
The requested information has not been provided for 30 days,
this issue will be closed automatically in 14 days.
close-issue-message: >-
This issue has been closed because the requested information has not been provided.
Feel free to reopen it with the requested information.
days-before-issue-stale: 30
days-before-issue-close: 14
days-before-pr-stale: -1
days-before-pr-close: -1
ascending: true
operations-per-run: 750
5 changes: 5 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

# The changelog and plugin manifest checks read the pull request files
permissions:
contents: "read"
pull-requests: "read"

jobs:
generate-ci-matrix:
name: "Generate CI matrix"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/label-commenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Label commenter"

on:
issues:
types:
- "labeled"

jobs:
comment:
# Labels of label-commenter-config.yml, any other label would start a no-op runner
if: contains(fromJSON('["invalid", "support", "feature suggestion", "not reproducible", "security report"]'), github.event.label.name)
permissions:
contents: "read"
issues: "write"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1
with:
persist-credentials: false

- name: "Label commenter"
uses: "peaceiris/actions-label-commenter@f0dbbef043eb1b150b566db36b0bdc8b7f505579" # v1.10.0
23 changes: 23 additions & 0 deletions .github/workflows/need-feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Need feedback"

on:
issue_comment:
types:
- "created"

jobs:
answered:
if: >-
github.repository == 'pluginsGLPI/empty'
&& github.event.comment.user.login == github.event.issue.user.login
&& contains(github.event.issue.labels.*.name, 'need feedback')
permissions:
issues: "write"
runs-on: "ubuntu-latest"
steps:
- name: "Remove the need feedback label"
env:
GH_TOKEN: "${{ github.token }}"
GH_REPO: "${{ github.repository }}"
ISSUE_NUMBER: "${{ github.event.issue.number }}"
run: gh issue edit "$ISSUE_NUMBER" --remove-label "need feedback"
File renamed without changes.
9 changes: 7 additions & 2 deletions plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,20 @@ if [ -d "$DEST" ]; then
exit 1
fi

read -r -p "Does your plugin include JS/TS files? [y/N] " has_js
read -r -p "Does your plugin include CSS/SCSS/SASS/LESS files? [y/N] " has_css
# No stdin (CI init script): `read` fails on EOF, answer the default "N"
read -r -p "Does your plugin include JS/TS files? [y/N] " has_js || true
read -r -p "Does your plugin include CSS/SCSS/SASS/LESS files? [y/N] " has_css || true

mkdir "$DEST"

rsync_excludes=(
--exclude '.git'
--exclude '.github/label-commenter-config.yml'
--exclude '.github/workflows/close_stale_issue.yml'
--exclude '.github/workflows/continuous-integration.yml'
--exclude '.github/workflows/create-plugin.sh'
--exclude '.github/workflows/label-commenter.yml'
--exclude '.github/workflows/need-feedback.yml'
--exclude 'plugin.sh'
--exclude 'dist'
--exclude 'README.md'
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$current_plugin_folder = basename(dirname(__DIR__));

require __DIR__ . '/../../../tests/bootstrap.php';
require dirname(__DIR__) . '/vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

if (!Plugin::isPluginActive($current_plugin_folder)) {
throw new RuntimeException(sprintf('Plugin %s is not active in the test database', $current_plugin_folder));
Expand Down