Skip to content
Open
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
9 changes: 8 additions & 1 deletion .github/workflows/firefox-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ jobs:
run: npm ci

- name: Update Firefox metadata
run: npm run release:update-firefox-metadata -- --version "${{ inputs.version }}"
run: |
if [[ ! "$FIREFOX_METADATA_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Firefox version must use x.y.z semver format" >&2
exit 1
fi
Comment on lines +30 to +34

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.

Informational

1. Implicit bash dependency 🐞 Bug ⚙ Maintainability

此步驟新增了 bash 專用的 [[ ... =~ ... ]] 正則判斷,但 workflow/step 未明確指定 shell: bash,未來若 workflow 預設 shell
被調整(或重用到非 bash 環境)會導致語法錯誤而使更新步驟失敗。
Agent Prompt
### Issue description
The workflow step relies on bash-specific syntax (`[[ ... =~ ... ]]`) but does not explicitly pin the shell. This creates a portability/maintenance hazard: if the workflow’s default shell changes or the job is later adapted to a different runner/shell, the step may fail with a syntax error.

### Issue Context
The current step uses `[[` and `=~` for regex validation. These are not POSIX `sh` features.

### Fix Focus Areas
- .github/workflows/firefox-metadata.yml[30-36]

### Suggested fix
Add `shell: bash` to the step (or define `defaults: run: shell: bash` for the job/workflow), **or** rewrite the validation in POSIX-compatible `sh` (e.g., using `case`/`grep -E`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


npm run release:update-firefox-metadata -- --version "$FIREFOX_METADATA_VERSION"
env:
FIREFOX_METADATA_VERSION: ${{ inputs.version }}
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}