A local-first personal finance app
Fix script injection patterns in GitHub Actions workflows (#7433)
Matiss Janis Aboltins4efa8bba0433
diff --git a/.github/workflows/generate-release-pr.yml b/.github/workflows/generate-release-pr.ymlindex 21e947842f..df04aa8f95 100644--- a/.github/workflows/generate-release-pr.yml+++ b/.github/workflows/generate-release-pr.yml@@ -27,6 +27,8 @@ jobs:- name: Bump package versionsid: bump_package_versionsshell: bash+ env:+ INPUT_VERSION: ${{ github.event.inputs.version }}run: |declare -A packages=([web]="desktop-client"@@ -40,10 +42,10 @@ jobs:for key in "${!packages[@]}"; dopkg="${packages[$key]}"- if [[ -n "${{ github.event.inputs.version }}" ]]; then+ if [[ -n "$INPUT_VERSION" ]]; thenversion=$(yarn workspace @actual-app/ci-actions tsx bin/get-next-package-version.ts \--package-json "./packages/$pkg/package.json" \- --version "${{ github.event.inputs.version }}" \+ --version "$INPUT_VERSION" \--update)elseversion=$(yarn workspace @actual-app/ci-actions tsx bin/get-next-package-version.ts \diff --git a/.github/workflows/vrt-update-apply.yml b/.github/workflows/vrt-update-apply.ymlindex 083eaca6c8..c372602f00 100644--- a/.github/workflows/vrt-update-apply.yml+++ b/.github/workflows/vrt-update-apply.yml@@ -134,11 +134,14 @@ jobs:- name: Comment on PR - Failureif: failure() && steps.metadata.outputs.pr_number != ''uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0+ env:+ APPLY_ERROR: ${{ steps.apply.outputs.error }}+ PR_NUMBER: ${{ steps.metadata.outputs.pr_number }}with:script: |- const error = `${{ steps.apply.outputs.error }}` || 'Unknown error occurred';+ const error = process.env.APPLY_ERROR || 'Unknown error occurred';await github.rest.issues.createComment({- issue_number: ${{ steps.metadata.outputs.pr_number }},+ issue_number: parseInt(process.env.PR_NUMBER, 10),owner: context.repo.owner,repo: context.repo.repo,body: `❌ Failed to apply VRT updates: ${error}\n\nPlease check the workflow logs for details.`diff --git a/upcoming-release-notes/7433.md b/upcoming-release-notes/7433.mdnew file mode 100644index 0000000000..3b3169d533--- /dev/null+++ b/upcoming-release-notes/7433.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [actualbudget]+---++Fix script injection patterns in GitHub Actions workflows