Skip to content

Apply recommended security fixes for github actions#3063

Open
samuelwei wants to merge 11 commits intodevelopfrom
improve-actions-security
Open

Apply recommended security fixes for github actions#3063
samuelwei wants to merge 11 commits intodevelopfrom
improve-actions-security

Conversation

@samuelwei
Copy link
Copy Markdown
Collaborator

@samuelwei samuelwei commented Apr 16, 2026

Type

  • Bugfix
  • Feature
  • Documentation
  • Refactoring (e.g. Style updates, Test implementation, etc.)
  • Other (please describe): CI / Security

Checklist

  • Code updated to current develop branch head
  • Passes CI checks
  • Is a part of an issue
  • Tests added for the bugfix or newly implemented feature, describe below why if not
  • Changelog is updated
  • Documentation of code and features exists

Changes

Other information

Summary by CodeRabbit

  • New Features

    • Automatic creation of locale update pull requests when locale changes are detected; locale job concurrency now cancels in-progress runs.
  • Chores

    • Tightened workflow permissions and disabled credential persistence on checkouts for safer CI.
    • Pinned third‑party actions to fixed commits for more reproducible runs.
    • Upgraded Docker-related actions and updated the Redis service image.
    • Adjusted artifact names and upload/archiving behavior.
    • Added Dependabot config to include GitHub Actions updates weekly.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Top-level workflow permissions added/adjusted across multiple GitHub Actions; many uses: steps were pinned to commit SHAs; actions/checkout steps set persist-credentials: false; CI-specific tweaks (Redis image, artifact naming/archive flags) and small release/PR script refactors applied.

Changes

Cohort / File(s) Summary
Workflow security & action pinning
\.github/workflows/ci-docker.yml, \.github/workflows/ci.yml, \.github/workflows/deploy-docs.yml, \.github/workflows/publiccode-yml-validation.yml, \.github/workflows/pull-locales.yml, \.github/workflows/update-bbb-recording-player.yml, \.github/workflows/update-publiccode-on-release.yml, \.github/workflows/upload-locales.yml
Added/adjusted top-level permissions, replaced many uses: version tags with pinned commit SHAs, and set persist-credentials: false on actions/checkout.
CI / Docker
\.github/workflows/ci-docker.yml, \.github/workflows/ci.yml
Pinned Docker-related actions to specific SHAs/versions; ci.yml changed Redis service to redis:8-alpine, renamed Docker artifact to pilos-image.tar, and set some actions/upload-artifact steps archive: false.
Release & PR automation
\.github/workflows/update-publiccode-on-release.yml, \.github/workflows/update-bbb-recording-player.yml
Refactored release/PR flows to use env variables, replaced inline shell interpolation with explicit scripting, generate PR body files, and switched to pinned peter-evans/create-pull-request usage.
Localization workflows
\.github/workflows/pull-locales.yml, \.github/workflows/upload-locales.yml
Added workflow and job permissions, introduced concurrency and job outputs in pull-locales, pinned actions, set persist-credentials: false, and added a conditional create-locales-pr job triggered when locale changes exist.
Docs Pages deploy
\.github/workflows/deploy-docs.yml
Pinned actions/checkout and actions/setup-node to commit SHAs, set persist-credentials: false, and replaced Pages upload/deploy actions with pinned commits.
Publiccode validation
\.github/workflows/publiccode-yml-validation.yml
Pinned actions/checkout and italia/publiccode-parser-action to commit SHAs and set persist-credentials: false.
Dependabot config
\.github/dependabot.yml
Added cooldown.default-days: 7, introduced a github-actions update entry for "/", and standardized weekly schedule/time/timezone settings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. While the type (CI/Security) is specified, the critical 'Changes' section is entirely empty with only placeholder dashes, and the 'Fixes #' issue reference is missing. Complete the 'Changes' section with a bullet-point summary of the workflow security improvements made, and add the relevant issue number in the 'Fixes #' field if this addresses a specific issue.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: applying security fixes to GitHub Actions workflows by pinning action versions and adding permission constraints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve-actions-security

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/pull-locales.yml Fixed
Comment thread .github/workflows/upload-locales.yml Fixed
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.72%. Comparing base (e086f05) to head (739230a).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3063      +/-   ##
=============================================
- Coverage      96.75%   96.72%   -0.03%     
  Complexity      1924     1924              
=============================================
  Files            457      457              
  Lines          12988    12988              
  Branches        2079     2079              
=============================================
- Hits           12566    12563       -3     
- Misses           422      425       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/update-bbb-recording-player.yml:
- Around line 7-8: The workflow currently grants only contents: write which
allows pushing commits but not creating/updating PRs; update the workflow
permissions block to include pull-requests: write alongside contents: write so
the peter-evans/create-pull-request action using GITHUB_TOKEN can create or
update PRs; locate the permissions section and add the pull-requests: write
entry and keep contents: write unchanged to ensure both push and PR creation
actions succeed.
- Around line 40-43: The bash expansion is invalid because of spaces inside the
parameter braces; update the echo command that sets NEEDS_UPDATE to use proper
expansions like ${LATEST_PLAYER_VERSION} and ${CURRENT_PLAYER_VERSION} (no
spaces) and ensure the expression is quoted or grouped properly so dpkg
--compare-versions runs correctly; specifically edit the line that writes to
$GITHUB_ENV to reference LATEST_PLAYER_VERSION and CURRENT_PLAYER_VERSION
without spaces and preserve the conditional structure that outputs "true" or
"false".

In @.github/workflows/update-publiccode-on-release.yml:
- Around line 16-19: The workflow currently uses an invalid Bash expansion (`${
VERSION }`) and disables persisted credentials so the later git push will fail;
update the variable usage to `${VERSION}` (no spaces) wherever referenced, and
restore or enable authentication before the push: either remove or set
`persist-credentials: true` in the checkout step (undoing the line with
`persist-credentials: false`) or, if keeping `persist-credentials: false`, add
an authenticated remote set step using the `GITHUB_TOKEN` (e.g., run a step that
calls `git remote set-url origin
https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git`)
before the git commit/push steps so the push succeeds.

In @.github/workflows/upload-locales.yml:
- Line 51: The pinned setup action SHA/comment pair is inconsistent: the SHA
accd6127cb78bee3e8082180cb391013d204ef9f does not match the trailing comment
v2.37.0 (see the uses:
shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f line);
regenerate the pin/comment pair by either (A) replacing the SHA with the commit
that actually corresponds to tag v2.37.0, or (B) updating the comment to the tag
that the current SHA points to, and apply the same correction to all other
workflow files in this PR that reuse the same uses: shivammathur/setup-php@...
entry so the SHA and the posted tag/comment are consistent for auditability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 86cd44f3-ac74-4e51-9336-3b0ebb03964e

📥 Commits

Reviewing files that changed from the base of the PR and between f786427 and 6b2ee10.

📒 Files selected for processing (8)
  • .github/workflows/ci-docker.yml
  • .github/workflows/ci.yml
  • .github/workflows/deploy-docs.yml
  • .github/workflows/publiccode-yml-validation.yml
  • .github/workflows/pull-locales.yml
  • .github/workflows/update-bbb-recording-player.yml
  • .github/workflows/update-publiccode-on-release.yml
  • .github/workflows/upload-locales.yml

Comment thread .github/workflows/update-bbb-recording-player.yml Outdated
Comment thread .github/workflows/update-bbb-recording-player.yml Outdated
Comment thread .github/workflows/update-publiccode-on-release.yml
Comment thread .github/workflows/upload-locales.yml Outdated
@cypress
Copy link
Copy Markdown

cypress bot commented Apr 16, 2026

PILOS    Run #2960

Run Properties:  status check failed Failed #2960  •  git commit 739230a72d: Apply recommended security fixes for github actions
Project PILOS
Branch Review improve-actions-security
Run status status check failed Failed #2960
Run duration 07m 13s
Commit git commit 739230a72d: Apply recommended security fixes for github actions
Committer Samuel Weirich
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 621
View all changes introduced in this branch ↗︎

Tests for review

Failed  e2e/RoomsJoinWithLobby.cy.js • 1 failed test • System tests

View Output

Test Artifacts
Room Join with lobby settings > Lobby enabled for guests only Test Replay Screenshots

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

24-24: Pin service image by digest for deterministic CI security.

redis:8-alpine is still a mutable tag. Prefer pinning to a digest to avoid unreviewed upstream image drift in CI.

Suggested change
-        image: redis:8-alpine
+        image: redis:8-alpine@sha256:<verified-digest>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 24, The Redis service image is using a
mutable tag ("image: redis:8-alpine"); replace it with a pinned digest to ensure
deterministic CI (update the image field for the Redis service in the CI
workflow to the official redis:8-alpine@sha256:<digest> value). Obtain the
correct digest from the Docker Hub or GitHub Container Registry manifest for the
exact tag you want, then commit the image field change so CI uses the immutable
digest instead of the floating tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 24: The Redis service image is using a mutable tag ("image:
redis:8-alpine"); replace it with a pinned digest to ensure deterministic CI
(update the image field for the Redis service in the CI workflow to the official
redis:8-alpine@sha256:<digest> value). Obtain the correct digest from the Docker
Hub or GitHub Container Registry manifest for the exact tag you want, then
commit the image field change so CI uses the immutable digest instead of the
floating tag.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a739267a-45c6-4c2b-bce5-e83f00b58652

📥 Commits

Reviewing files that changed from the base of the PR and between 6b2ee10 and ffc524d.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • .github/workflows/pull-locales.yml
  • .github/workflows/upload-locales.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/pull-locales.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/upload-locales.yml

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the repository’s GitHub Actions setup by applying recommended CI/CD security practices (least-privilege permissions, pinned action revisions, and safer checkout defaults) and refreshing some CI dependencies.

Changes:

  • Add explicit permissions blocks to workflows and pin third-party actions to fixed commit SHAs.
  • Disable persist-credentials on actions/checkout across workflows to reduce token exposure.
  • Update various CI components (e.g., Redis service image, artifact naming/upload behavior) and extend Dependabot configuration.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/upload-locales.yml Adds workflow-level permissions and pins checkout/setup/cache actions; disables credential persistence.
.github/workflows/update-publiccode-on-release.yml Pins checkout, disables credential persistence, and rewires version/date injection into publiccode.yml.
.github/workflows/update-bbb-recording-player.yml Adds explicit permissions, pins actions, hardens version-compare step, and pins PR creation action.
.github/workflows/pull-locales.yml Adds explicit permissions, pins actions, disables credential persistence, and pins PR creation action.
.github/workflows/publiccode-yml-validation.yml Adds explicit permissions, pins checkout and publiccode parser action; disables credential persistence.
.github/workflows/deploy-docs.yml Adds explicit permissions, pins actions used for docs build and GitHub Pages deployment; disables credential persistence for checkout.
.github/workflows/ci.yml Adds explicit permissions, pins many actions, updates service image tag(s), and adjusts artifact handling/naming.
.github/workflows/ci-docker.yml Moves permissions to workflow scope, pins docker-related actions, disables credential persistence on checkout.
.github/dependabot.yml Adds cooldown scheduling and a new GitHub Actions update entry alongside existing ecosystems.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: develop
persist-credentials: false
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/checkout is configured with persist-credentials: false, but the workflow later runs git push origin develop. Without credentials configured for the remote, this push is likely to fail. Either keep credentials persisted for this workflow, or explicitly configure the remote to use GITHUB_TOKEN (with contents: write) before pushing.

Suggested change
persist-credentials: false
persist-credentials: true

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/update-publiccode-on-release.yml Outdated
@samuelwei
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/update-publiccode-on-release.yml (1)

52-52: Use a versioned branch name to avoid cross-release PR collisions.

Line 52 uses a fixed branch (update-publiccode), which can cause later release runs to overwrite/update an unrelated open PR.

Suggested fix
-          branch: "update-publiccode"
+          branch: "update-publiccode-${{ steps.release.outputs.version }}"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-publiccode-on-release.yml at line 52, The workflow
currently uses a fixed branch name branch: "update-publiccode" which risks
cross-release PR collisions; change the branch to a release-specific, versioned
name by replacing the static "update-publiccode" with a dynamically constructed
branch name using GitHub Actions context (e.g., include github.ref_name,
github.run_number or github.run_id or short SHA) so each run creates a unique
branch; update the workflow step that sets branch: "update-publiccode" to build
and use that dynamic branch value (search for the literal branch:
"update-publiccode" in the workflow).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/dependabot.yml:
- Around line 41-43: Update the dependabot configuration so that for
package-ecosystem "github-actions" the directory value is "/" instead of
".github/workflows"; locate the package-ecosystem: "github-actions" entry and
replace the directory key's value to "/" to ensure Dependabot scans GitHub
Actions workflows correctly.

---

Nitpick comments:
In @.github/workflows/update-publiccode-on-release.yml:
- Line 52: The workflow currently uses a fixed branch name branch:
"update-publiccode" which risks cross-release PR collisions; change the branch
to a release-specific, versioned name by replacing the static
"update-publiccode" with a dynamically constructed branch name using GitHub
Actions context (e.g., include github.ref_name, github.run_number or
github.run_id or short SHA) so each run creates a unique branch; update the
workflow step that sets branch: "update-publiccode" to build and use that
dynamic branch value (search for the literal branch: "update-publiccode" in the
workflow).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ae01b70b-dd6c-4b1c-a76b-663db3c252d7

📥 Commits

Reviewing files that changed from the base of the PR and between ffc524d and d7e80f1.

📒 Files selected for processing (3)
  • .github/dependabot.yml
  • .github/workflows/update-bbb-recording-player.yml
  • .github/workflows/update-publiccode-on-release.yml

Comment thread .github/dependabot.yml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pull-locales.yml:
- Around line 123-128: The artifact upload step ("Upload locale files" that uses
actions/upload-artifact) misses deleted locale files because the workflow
uploads the working directory, not staged Git deletions performed by
ImportLocalesCommand (see git add -A lang usage); change the workflow to produce
and upload a Git patch (e.g., git diff --staged --name-only --diff-filter=D or
git format-patch / git diff --staged > locales-deletions.patch) or capture the
full staged changes (commit the changes in a temp branch or create an archive
from the index) and upload that patch/archive so deletions are preserved for the
downstream job instead of relying on the working tree files. Ensure the same
change is applied to both affected upload steps.

In @.github/workflows/update-bbb-recording-player.yml:
- Around line 19-33: The workflow creates player-release.json and
player-release-notes.md before the checkout step, but actions/checkout (uses:
actions/checkout@...) cleans untracked files by default and will delete them;
move the Checkout step (the action step that uses
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd) so it runs before the
steps named "Get the latest BBB Recording Player release", "Extract the latest
BBB Recording Player version", and "Extract release notes" (or at least before
creating player-release.json and player-release-notes.md) so the created files
are not removed, preserving player-release-notes.md for the later PR body
creation.
- Around line 19-25: The GitHub Actions step "Get the latest BBB Recording
Player release" currently uses curl -s which won't fail on HTTP errors, causing
player-release.json to contain an error body and LATEST_PLAYER_VERSION to be
empty; change the curl invocation to fail on HTTP errors (e.g., use curl -fS
--show-error or --fail) so the step fails fast on non-2xx responses, keep
writing to player-release.json only on success, and in the "Extract the latest
BBB Recording Player version" step validate that the extracted
LATEST_PLAYER_VERSION (from player-release.json via jq) is non-empty and exit
with a failure if it's missing so the downstream dpkg --compare-versions logic
cannot silently treat an API failure as NEEDS_UPDATE=false.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3d30a3b5-da9b-4dd6-8c42-1a4ac7ca9263

📥 Commits

Reviewing files that changed from the base of the PR and between 348804e and 739230a.

📒 Files selected for processing (2)
  • .github/workflows/pull-locales.yml
  • .github/workflows/update-bbb-recording-player.yml

Comment on lines +123 to +128
- name: Upload locale files
if: steps.locale-changes.outputs.has_changes == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: locale-files
path: lang/**/*.php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For actions/upload-artifactandactions/download-artifact, if a first job stages deletions with Git, can those deletions be preserved by uploading only the current files, or is a patch/archive needed to carry deletions into a later job?

💡 Result:

No, uploading only the current files with actions/upload-artifact does not preserve Git-staged deletions when downloaded in a later job. Artifacts capture and restore only the existing files in the filesystem at upload time as a zip archive; staged deletions (in Git's index but not yet committed or reflected in the working directory) are not part of the filesystem snapshot and thus are lost upon download and extraction in the new job's clean workspace. To preserve deletions across jobs, create a Git patch capturing the staged changes (including deletions) and upload that as an artifact. In the later job, download and apply the patch after checkout. Example workflow snippet: First job (after staging deletions with git add -u or similar): - name: Create patch run: git diff --cached > changes.patch - uses: actions/upload-artifact@v4 with: name: git-changes path: changes.patch Later job: - uses: actions/checkout@v4 - uses: actions/download-artifact@v5 with: name: git-changes - name: Apply patch run: git apply changes.patch This applies the staged changes, including deletions, to the fresh checkout. Note: git apply works for uncommitted diffs; for more complex scenarios, consider archiving the entire .git directory (though large and not recommended) or committing changes before artifacting the repo state.

Citations:


Artifacts lose deleted locale files, leaving stale translations in the PR.

Line 125 uploads only files that exist at upload time, but app/Console/Commands/ImportLocalesCommand.php:91-111 deletes old locale PHP files before regenerating them. Since git add -A lang on lines 105–106 stages those deletions, the second job never receives them—artifacts capture only the working directory, not staged deletions from Git's index. The resulting PR can miss removed locale files.

Suggested fix: use a Git patch instead
       - name: Detect locale changes
         id: locale-changes
         run: |
           git add -A lang
           if git diff --cached --quiet; then
             echo "has_changes=false" >> "$GITHUB_OUTPUT"
             echo "No locale changes detected."
           else
             echo "has_changes=true" >> "$GITHUB_OUTPUT"
+            git diff --cached --binary -- lang > locale.patch
           fi

-      - name: Upload locale files
+      - name: Upload locale patch
         if: steps.locale-changes.outputs.has_changes == 'true'
         uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
         with:
-          name: locale-files
-          path: lang/**/*.php
+          name: locale-patch
+          path: locale.patch
...
-      - name: Download locale files
+      - name: Download locale patch
         uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
         with:
-          name: locale-files
+          name: locale-patch
+
+      - name: Apply locale patch
+        run: git apply --index locale.patch

Also applies to: 145–154

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pull-locales.yml around lines 123 - 128, The artifact
upload step ("Upload locale files" that uses actions/upload-artifact) misses
deleted locale files because the workflow uploads the working directory, not
staged Git deletions performed by ImportLocalesCommand (see git add -A lang
usage); change the workflow to produce and upload a Git patch (e.g., git diff
--staged --name-only --diff-filter=D or git format-patch / git diff --staged >
locales-deletions.patch) or capture the full staged changes (commit the changes
in a temp branch or create an archive from the index) and upload that
patch/archive so deletions are preserved for the downstream job instead of
relying on the working tree files. Ensure the same change is applied to both
affected upload steps.

Comment on lines 19 to +33
- name: Get the latest BBB Recording Player release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s --request GET \
--url "https://api.github.com/repos/bigbluebutton/bbb-playback/releases/latest" \
--header "Authorization: Bearer $GH_TOKEN" \
> player-release.json
- name: Extract the latest BBB Recording Player version
run: echo "LATEST_PLAYER_VERSION=$(jq -r '.tag_name' player-release.json | sed 's/^v//')" >> $GITHUB_ENV
- name: Extract release notes
run: |
RELEASE_NOTES=$(jq -r '.body' player-release.json)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$RELEASE_NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
jq -r '.body // ""' player-release.json > player-release-notes.md
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
persist-credentials: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

For actions/checkout@v6, what is the default value of clean, and does it delete untracked files created earlier in $GITHUB_WORKSPACE?

💡 Result:

The default value of clean for actions/checkout@v6 is true. When clean is true (the default), it executes git clean -ffdx && git reset --hard HEAD before fetching, which deletes untracked files (including those created earlier in $GITHUB_WORKSPACE) and resets any changes. Yes, it deletes untracked files created earlier in $GITHUB_WORKSPACE.

Citations:


Move checkout before creating release notes file.

The actions/checkout@v6 action has clean: true by default, which runs git clean -ffdx && git reset --hard HEAD to delete untracked files. Since lines 19-28 create player-release.json and player-release-notes.md as untracked files before checkout at line 30, these files will be deleted. When line 61 attempts to read player-release-notes.md to create the PR body, it will fail with a file-not-found error.

Suggested fix
-      - name: Get the latest BBB Recording Player release
-        run: |
-          curl -s --request GET \
-          --url "https://api.github.com/repos/bigbluebutton/bbb-playback/releases/latest" \
-          > player-release.json
-      - name: Extract the latest BBB Recording Player version
-        run: echo "LATEST_PLAYER_VERSION=$(jq -r '.tag_name' player-release.json | sed 's/^v//')" >> $GITHUB_ENV
-      - name: Extract release notes
-        run: |
-          jq -r '.body // ""' player-release.json > player-release-notes.md
       - name: Checkout
         uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
         with:
           fetch-depth: 2
           persist-credentials: false
+      - name: Get the latest BBB Recording Player release
+        run: |
+          curl -s --request GET \
+          --url "https://api.github.com/repos/bigbluebutton/bbb-playback/releases/latest" \
+          > player-release.json
+      - name: Extract the latest BBB Recording Player version
+        run: echo "LATEST_PLAYER_VERSION=$(jq -r '.tag_name' player-release.json | sed 's/^v//')" >> "$GITHUB_ENV"
+      - name: Extract release notes
+        run: |
+          jq -r '.body // ""' player-release.json > player-release-notes.md
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-bbb-recording-player.yml around lines 19 - 33, The
workflow creates player-release.json and player-release-notes.md before the
checkout step, but actions/checkout (uses: actions/checkout@...) cleans
untracked files by default and will delete them; move the Checkout step (the
action step that uses actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd)
so it runs before the steps named "Get the latest BBB Recording Player release",
"Extract the latest BBB Recording Player version", and "Extract release notes"
(or at least before creating player-release.json and player-release-notes.md) so
the created files are not removed, preserving player-release-notes.md for the
later PR body creation.

Comment on lines 19 to 25
- name: Get the latest BBB Recording Player release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -s --request GET \
--url "https://api.github.com/repos/bigbluebutton/bbb-playback/releases/latest" \
--header "Authorization: Bearer $GH_TOKEN" \
> player-release.json
- name: Extract the latest BBB Recording Player version
run: echo "LATEST_PLAYER_VERSION=$(jq -r '.tag_name' player-release.json | sed 's/^v//')" >> $GITHUB_ENV
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

With curlagainst the GitHub Releases API, does-salone fail the step on HTTP 4xx/5xx responses, and what doesjq -r '.tag_name' return when that field is missing?

💡 Result:

No, curl -s alone does not fail the step (i.e., it exits with code 0) on HTTP 4xx/5xx responses. The -s or --silent flag only suppresses progress meter and error messages to stderr; it does not affect the exit status. Curl exits with code 0 for HTTP 4xx/5xx unless -f/--fail is used, which causes exit code 22 on 4xx/5xx. With -s alone, the response body (often HTML error page for GitHub Releases API 404) is output to stdout, and no error is shown due to silence. jq -r '.tag_name' returns nothing (empty output, no characters, not even "null") when the .tag_name field is missing or null in the input JSON. For a missing field in an object, .tag_name yields null; -r on null produces no output. For GitHub Releases API success (200), tag_name is present as required string. For 404 error, the body is an error object like {"message": "Not Found", ...} without tag_name, so jq outputs nothing. jq exits 0 unless using -e and result is false/null with no output.

Citations:


🏁 Script executed:

cat -n .github/workflows/update-bbb-recording-player.yml

Repository: THM-Health/PILOS

Length of output: 3827


🏁 Script executed:

#!/bin/bash
# Test dpkg --compare-versions with empty version
echo "Testing dpkg --compare-versions with empty version:"
dpkg --compare-versions "" gt "1.0.0" && echo "Exit: $?" || echo "Exit: $?"

echo -e "\nTesting dpkg --compare-versions with valid versions:"
dpkg --compare-versions "2.0.0" gt "1.0.0" && echo "Exit: $?" || echo "Exit: $?"

echo -e "\nTesting jq on error JSON (GitHub 404 response):"
# Simulate GitHub 404 response
echo '{"message": "Not Found", "documentation_url": "https://docs.github.com/rest/releases/releases#get-the-latest-release"}' | jq -r '.tag_name'
echo "jq exit code: $?"

echo -e "\nTesting jq on empty/null field with -r flag:"
echo '{"body": "some content"}' | jq -r '.tag_name'
echo "jq exit code for missing field: $?"

echo -e "\nTesting jq with -e flag on missing field:"
echo '{"body": "some content"}' | jq -e '.tag_name'
echo "jq -e exit code: $?"

Repository: THM-Health/PILOS

Length of output: 510


Fail fast when the GitHub release fetch fails.

Line 21 uses curl -s, which does not fail on HTTP 4xx/5xx errors—the error response body is written to player-release.json. Line 25 then extracts an empty/null version from the error response, and the dpkg --compare-versions on lines 38-42 treats this as a failed comparison, silently setting NEEDS_UPDATE=false instead of alerting to the API failure.

Suggested fix
       - name: Get the latest BBB Recording Player release
         run: |
-          curl -s --request GET \
-          --url "https://api.github.com/repos/bigbluebutton/bbb-playback/releases/latest" \
-          > player-release.json
+          curl --fail-with-body --silent --show-error \
+            --retry 3 --retry-all-errors \
+            --request GET \
+            --url "https://api.github.com/repos/bigbluebutton/bbb-playback/releases/latest" \
+            > player-release.json
       - name: Extract the latest BBB Recording Player version
-        run: echo "LATEST_PLAYER_VERSION=$(jq -r '.tag_name' player-release.json | sed 's/^v//')" >> $GITHUB_ENV
+        run: echo "LATEST_PLAYER_VERSION=$(jq -e -r '.tag_name' player-release.json | sed 's/^v//')" >> "$GITHUB_ENV"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-bbb-recording-player.yml around lines 19 - 25, The
GitHub Actions step "Get the latest BBB Recording Player release" currently uses
curl -s which won't fail on HTTP errors, causing player-release.json to contain
an error body and LATEST_PLAYER_VERSION to be empty; change the curl invocation
to fail on HTTP errors (e.g., use curl -fS --show-error or --fail) so the step
fails fast on non-2xx responses, keep writing to player-release.json only on
success, and in the "Extract the latest BBB Recording Player version" step
validate that the extracted LATEST_PLAYER_VERSION (from player-release.json via
jq) is non-empty and exit with a failure if it's missing so the downstream dpkg
--compare-versions logic cannot silently treat an API failure as
NEEDS_UPDATE=false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants