From e0dec3feb8ec2b5b8bf0e23562b0ad9d81b93c5d Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 13 Nov 2026 14:17:14 +0100 Subject: [PATCH 1/6] Fix: sync issue triage labels and skip unchanged labels --- .github/scripts/sync.sh | 8 ++++---- sync/labels.json | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/scripts/sync.sh b/.github/scripts/sync.sh index 5d1ee26..ada8dbe 100755 --- a/.github/scripts/sync.sh +++ b/.github/scripts/sync.sh @@ -129,10 +129,10 @@ while read -r repo; do continue fi - # Label names are case insensitive, extra labels of the repository are kept - current_labels="$(gh api "repos/$repo/labels?per_page=100" --paginate --jq '.[] | {name, color, description}' | jq -s .)" + # Label names are case insensitive, extra labels of the repository are kept; keys are sorted and a null description is empty so unchanged labels compare equal + current_labels="$(gh api "repos/$repo/labels?per_page=100" --paginate --jq '.[] | {name, color, description: (.description // "")}' | jq -s .)" while read -r label; do - current_label="$(jq -c --argjson label "$label" 'map(select((.name | ascii_downcase) == ($label.name | ascii_downcase)))[0] // empty' <<< "$current_labels")" + current_label="$(jq -cS --argjson label "$label" 'map(select((.name | ascii_downcase) == ($label.name | ascii_downcase)))[0] // empty' <<< "$current_labels")" if [[ -z "$current_label" ]]; then method="POST" url="repos/$repo/labels" action="created" body="$label" elif [[ "$current_label" != "$label" ]]; then @@ -147,7 +147,7 @@ while read -r repo; do gh api --method "$method" "$url" --input - --silent <<< "$body" echo "$repo: label $action: $label" fi - done < <(jq -c '.[] | {name, color, description}' "$labels_file") + done < <(jq -cS '.[] | {name, color, description: (.description // "")}' "$labels_file") git clone --quiet --depth 1 "https://x-access-token:${GH_TOKEN}@github.com/${repo}.git" "$repo_dir" default_branch="$(git -C "$repo_dir" rev-parse --abbrev-ref HEAD)" diff --git a/sync/labels.json b/sync/labels.json index b28f647..25d205c 100644 --- a/sync/labels.json +++ b/sync/labels.json @@ -3,5 +3,20 @@ "name": "no forward-port", "color": "cfd3d7", "description": "Do not forward-port this pull request to the next branch" + }, + { + "name": "invalid", + "color": "e4e669", + "description": "This doesn't seem right" + }, + { + "name": "support", + "color": "06ECC1", + "description": "" + }, + { + "name": "feature suggestion", + "color": "0E8A16", + "description": "" } ] From 59bdd25a055a906ae8e50c81b43f7b0a0ec68154 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 13 Nov 2026 14:25:41 +0100 Subject: [PATCH 2/6] Feat: add lint and sync dry run CI --- .github/workflows/ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..da07faa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: "Continuous integration" + +on: + push: + branches: + - "main" + pull_request: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +permissions: + contents: "read" + +jobs: + lint: + name: "Lint" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout" + uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1 + with: + persist-credentials: false + - name: "Lint workflows" + # Synced workflows are not under .github/workflows, so they are listed explicitly + run: | + docker run --rm --volume "$PWD:/repo" --workdir /repo \ + rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 \ + -color .github/workflows/*.yml sync/files/.github/workflows/*.yml sync/files-public/.github/workflows/*.yml + - name: "Lint shell scripts" + run: | + docker run --rm --volume "$PWD:/mnt" --workdir /mnt \ + koalaman/shellcheck@sha256:61862eba1fcf09a484ebcc6feea46f1782532571a34ed51fedf90dd25f925a8d \ + .github/scripts/*.sh + - name: "Validate JSON files" + run: | + for file in sync/*.json; do + jq empty "$file" + done + + sync-dry-run: + name: "Sync dry run" + # Fork pull requests get no secrets + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + runs-on: "ubuntu-latest" + steps: + - name: "Checkout" + uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1 + with: + persist-credentials: false + - name: "Generate read-only app token" + id: "app-token" + uses: "actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510" # v3.3.0 + with: + client-id: "${{ vars.SYNC_APP_CLIENT_ID }}" + private-key: "${{ secrets.SYNC_APP_PRIVATE_KEY }}" + owner: "${{ github.repository_owner }}" + # The pull request runs unreviewed code, read access keeps it from writing to the synced repositories + permission-administration: "read" + permission-contents: "read" + permission-pull-requests: "read" + - name: "Show sync changes" + run: ".github/scripts/sync.sh" + env: + GH_TOKEN: "${{ steps.app-token.outputs.token }}" + DRY_RUN: "true" From b6ef4e8e9b8ddb303a29ded98b1704e8926647a6 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 13 Nov 2026 14:29:51 +0100 Subject: [PATCH 3/6] Fix: skip merge settings hidden from the dry run token --- .github/scripts/sync.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/scripts/sync.sh b/.github/scripts/sync.sh index ada8dbe..01f3e69 100755 --- a/.github/scripts/sync.sh +++ b/.github/scripts/sync.sh @@ -54,6 +54,14 @@ while read -r repo; do repo_dir="$work_dir/$name" repo_json="$(gh api "repos/$repo")" + # Merge settings are hidden from tokens without contents write, such as the read-only pull request dry run token: settings missing from the response count as applied + if [[ "$dry_run" == "true" && "$(jq '.allow_merge_commit == null' <<< "$repo_json")" == "true" ]]; then + if [[ -z "${hidden_settings_reported:-}" ]]; then + echo "merge settings not visible with a read-only token, skipped" + hidden_settings_reported="true" + fi + repo_json="$(jq --slurpfile wanted "$settings_file" '$wanted[0] + with_entries(select(.value != null))' <<< "$repo_json")" + fi # The API rejects a commit title or message sent without its counterpart settings_diff="$(jq -c --slurpfile wanted "$settings_file" ' . as $current | $wanted[0] as $wanted From fe37fc76793fdc920d0c91bbe8d5ca28035c4361 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 13 Nov 2026 16:20:28 +0100 Subject: [PATCH 4/6] Feat: close issues waiting for information from the author --- README.md | 1 + .../.github/label-commenter-config.yml | 2 +- .../.github/workflows/close_stale_issue.yml | 20 ++++++++++++++-- .../workflows/need-more-information.yml | 23 +++++++++++++++++++ sync/labels.json | 5 ++++ 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 sync/files/.github/workflows/need-more-information.yml diff --git a/README.md b/README.md index ef9b22d..bc0cec3 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Default community health files (issue and pull request templates, security polic Files in `sync/files/` are pushed through a pull request to every non archived repository of the organization tagged with the `sync-org-files` topic; paths listed in `sync/delete.txt` are removed from them. Files in `sync/files-public/` are pushed the same way to public repositories only, and removed from private ones. After each successful run of the automatic tag workflow, the synced `open-xml-update-pr.yml` workflow opens a pull request copying the `` block of the matching tag's plugin XML (`plugin.xml` or `.xml`) to the default branch, with the `GLPI_PROJECT_BOT` GitHub App, which needs the pull requests write permission. +Issues labelled `need more information` are closed by the stale workflow after 44 days without activity; the synced `need-more-information.yml` workflow removes the label when the issue author comments. Repository settings in `sync/settings.json` (any field of the [update a repository](https://docs.github.com/rest/repos/repos#update-a-repository) API) are applied directly to the same repositories, along with release immutability, Dependabot alerts and security updates, and private vulnerability reporting, secret scanning and push protection (public repositories only). The protection of the default branch and of `X.Y/bugfixes` branches is aligned on `sync/branch-protection.json` (body of the [update branch protection](https://docs.github.com/rest/branches/branch-protection#update-branch-protection) API). Labels in `sync/labels.json` (`name`, `color` and `description`) are created, or updated when their color or description differs; other labels of the repositories are kept. diff --git a/sync/files-public/.github/label-commenter-config.yml b/sync/files-public/.github/label-commenter-config.yml index 5f2918e..c4395a8 100644 --- a/sync/files-public/.github/label-commenter-config.yml +++ b/sync/files-public/.github/label-commenter-config.yml @@ -20,6 +20,6 @@ labels: 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://glpi.userecho.com/). + 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://portal.glpi-network.com/contact-us) directly if you are willing to sponsor this feature. action: "close" diff --git a/sync/files/.github/workflows/close_stale_issue.yml b/sync/files/.github/workflows/close_stale_issue.yml index 9ba763c..ad571d2 100644 --- a/sync/files/.github/workflows/close_stale_issue.yml +++ b/sync/files/.github/workflows/close_stale_issue.yml @@ -12,7 +12,7 @@ jobs: pull-requests: "write" # for actions/stale to close stale pull requests runs-on: "ubuntu-latest" steps: - - uses: "actions/stale@v11" + - 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 @@ -28,9 +28,25 @@ jobs: days-before-issue-stale: 60 days-before-pr-stale: 90 days-before-close: 14 - exempt-issue-labels: "bug,enhancement,question,security" # Issues with "bug", "enhancement", "question" or "security" labels will not be marked as stale + exempt-issue-labels: "bug,enhancement,question,security,need more information" # Issues with "bug", "enhancement", "question" or "security" labels will not be marked as stale, "need more information" 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 more information" + 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 diff --git a/sync/files/.github/workflows/need-more-information.yml b/sync/files/.github/workflows/need-more-information.yml new file mode 100644 index 0000000..a7b9184 --- /dev/null +++ b/sync/files/.github/workflows/need-more-information.yml @@ -0,0 +1,23 @@ +name: "Need more information" + +on: + issue_comment: + types: + - "created" + +jobs: + answered: + if: >- + github.repository == 'pluginsGLPI/{PLUGIN}' + && github.event.comment.user.login == github.event.issue.user.login + && contains(github.event.issue.labels.*.name, 'need more information') + permissions: + issues: "write" + runs-on: "ubuntu-latest" + steps: + - name: "Remove the need more information 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 more information" diff --git a/sync/labels.json b/sync/labels.json index 25d205c..851994a 100644 --- a/sync/labels.json +++ b/sync/labels.json @@ -18,5 +18,10 @@ "name": "feature suggestion", "color": "0E8A16", "description": "" + }, + { + "name": "need more information", + "color": "d876e3", + "description": "Waiting for information from the issue author" } ] From 2378a71301491179075622451275c743d0802984 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 13 Nov 2026 16:27:04 +0100 Subject: [PATCH 5/6] Feat: add not reproducible and security report closing labels. --- README.md | 2 +- .../.github/label-commenter-config.yml | 16 ++++++++++++++++ .../.github/workflows/close_stale_issue.yml | 4 ++-- ...ed-more-information.yml => need-feedback.yml} | 8 ++++---- sync/labels.json | 14 ++++++++++++-- 5 files changed, 35 insertions(+), 9 deletions(-) rename sync/files/.github/workflows/{need-more-information.yml => need-feedback.yml} (73%) diff --git a/README.md b/README.md index bc0cec3..69aaaa0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Default community health files (issue and pull request templates, security polic Files in `sync/files/` are pushed through a pull request to every non archived repository of the organization tagged with the `sync-org-files` topic; paths listed in `sync/delete.txt` are removed from them. Files in `sync/files-public/` are pushed the same way to public repositories only, and removed from private ones. After each successful run of the automatic tag workflow, the synced `open-xml-update-pr.yml` workflow opens a pull request copying the `` block of the matching tag's plugin XML (`plugin.xml` or `.xml`) to the default branch, with the `GLPI_PROJECT_BOT` GitHub App, which needs the pull requests write permission. -Issues labelled `need more information` are closed by the stale workflow after 44 days without activity; the synced `need-more-information.yml` workflow removes the label when the issue author comments. +Issues labelled `need feedback` are closed by the stale workflow after 44 days without activity; the synced `need-feedback.yml` workflow removes the label when the issue author comments. Repository settings in `sync/settings.json` (any field of the [update a repository](https://docs.github.com/rest/repos/repos#update-a-repository) API) are applied directly to the same repositories, along with release immutability, Dependabot alerts and security updates, and private vulnerability reporting, secret scanning and push protection (public repositories only). The protection of the default branch and of `X.Y/bugfixes` branches is aligned on `sync/branch-protection.json` (body of the [update branch protection](https://docs.github.com/rest/branches/branch-protection#update-branch-protection) API). Labels in `sync/labels.json` (`name`, `color` and `description`) are created, or updated when their color or description differs; other labels of the repositories are kept. diff --git a/sync/files-public/.github/label-commenter-config.yml b/sync/files-public/.github/label-commenter-config.yml index c4395a8..e9acddf 100644 --- a/sync/files-public/.github/label-commenter-config.yml +++ b/sync/files-public/.github/label-commenter-config.yml @@ -23,3 +23,19 @@ labels: 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://portal.glpi-network.com/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" diff --git a/sync/files/.github/workflows/close_stale_issue.yml b/sync/files/.github/workflows/close_stale_issue.yml index ad571d2..b459af7 100644 --- a/sync/files/.github/workflows/close_stale_issue.yml +++ b/sync/files/.github/workflows/close_stale_issue.yml @@ -28,7 +28,7 @@ jobs: days-before-issue-stale: 60 days-before-pr-stale: 90 days-before-close: 14 - exempt-issue-labels: "bug,enhancement,question,security,need more information" # Issues with "bug", "enhancement", "question" or "security" labels will not be marked as stale, "need more information" ones are handled by the next step + 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. @@ -37,7 +37,7 @@ jobs: # 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 more information" + 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. diff --git a/sync/files/.github/workflows/need-more-information.yml b/sync/files/.github/workflows/need-feedback.yml similarity index 73% rename from sync/files/.github/workflows/need-more-information.yml rename to sync/files/.github/workflows/need-feedback.yml index a7b9184..3ec23e0 100644 --- a/sync/files/.github/workflows/need-more-information.yml +++ b/sync/files/.github/workflows/need-feedback.yml @@ -1,4 +1,4 @@ -name: "Need more information" +name: "Need feedback" on: issue_comment: @@ -10,14 +10,14 @@ jobs: if: >- github.repository == 'pluginsGLPI/{PLUGIN}' && github.event.comment.user.login == github.event.issue.user.login - && contains(github.event.issue.labels.*.name, 'need more information') + && contains(github.event.issue.labels.*.name, 'need feedback') permissions: issues: "write" runs-on: "ubuntu-latest" steps: - - name: "Remove the need more information label" + - 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 more information" + run: gh issue edit "$ISSUE_NUMBER" --remove-label "need feedback" diff --git a/sync/labels.json b/sync/labels.json index 851994a..04223da 100644 --- a/sync/labels.json +++ b/sync/labels.json @@ -20,8 +20,18 @@ "description": "" }, { - "name": "need more information", - "color": "d876e3", + "name": "need feedback", + "color": "fef2c0", "description": "Waiting for information from the issue author" + }, + { + "name": "not reproducible", + "color": "c5def5", + "description": "Could not be reproduced on the latest release" + }, + { + "name": "security report", + "color": "b60205", + "description": "Security problem reported publicly instead of privately" } ] From 6a02e74ae09a000e2f9581a7530478b186edad09 Mon Sep 17 00:00:00 2001 From: Rom1-B <8530352+Rom1-B@users.noreply.github.com> Date: Fri, 13 Nov 2026 16:33:01 +0100 Subject: [PATCH 6/6] Fix: update the editor team contact link --- sync/files-public/.github/label-commenter-config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync/files-public/.github/label-commenter-config.yml b/sync/files-public/.github/label-commenter-config.yml index e9acddf..d1bc4f1 100644 --- a/sync/files-public/.github/label-commenter-config.yml +++ b/sync/files-public/.github/label-commenter-config.yml @@ -12,7 +12,7 @@ labels: 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://portal.glpi-network.com/contact-us) directly. + You can also [contact GLPI editor team](https://glpi-project.org/contact_us/) directly. action: "close" - name: "feature suggestion" labeled: @@ -21,7 +21,7 @@ labels: 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://portal.glpi-network.com/contact-us) directly if you are willing to sponsor this feature. + 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: