Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Make importmap audit best-effort for publishing (#3372)

Sure Admin (bot)808438f2b19a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4eb595c2b3..5a36e52bd5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,6 +2,12 @@ name: CI
on:
workflow_call:
+ inputs:
+ require_js_dependency_audit:
+ description: "Fail the workflow when the importmap JavaScript dependency audit cannot complete"
+ required: false
+ type: boolean
+ default: false
jobs:
scan_ruby:
@@ -38,12 +44,20 @@ jobs:
bundler-cache: true
- name: Scan for security vulnerabilities in JavaScript dependencies
+ continue-on-error: ${{ !inputs.require_js_dependency_audit }}
+ env:
+ REQUIRE_JS_DEPENDENCY_AUDIT: ${{ inputs.require_js_dependency_audit }}
run: |
- for attempt in 1 2 3; do
- echo "Running importmap audit, attempt ${attempt}/3"
+ attempts=3
+ if [ "$REQUIRE_JS_DEPENDENCY_AUDIT" != "true" ]; then
+ attempts=1
+ fi
+
+ for attempt in $(seq 1 "$attempts"); do
+ echo "Running importmap audit, attempt ${attempt}/${attempts}"
bin/importmap audit && exit 0
- if [ "$attempt" = 3 ]; then
+ if [ "$attempt" = "$attempts" ]; then
exit 1
fi
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index eacc0b60af..b005a3b3ac 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -46,6 +46,8 @@ permissions:
jobs:
ci:
uses: ./.github/workflows/ci.yml
+ with:
+ require_js_dependency_audit: false
build:
name: Build Docker image