refactor: implement ConfigKeyKit and modernize MistDemo authentication #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check for unsafeFlags | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| dump-package-check: | |
| name: Dump Swift package (authoritative) and scan JSON | |
| runs-on: ubuntu-latest | |
| container: | |
| image: swift:latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install jq | |
| run: | | |
| apt-get update && apt-get install -y jq | |
| - name: Dump package JSON and check for unsafeFlags | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| # Compute unsafeFlags array directly from the dump (don't store the full dump variable) | |
| unsafe_flags=$(swift package dump-package | jq -c '[.. | objects | .unsafeFlags? // empty]') | |
| # Check array length to decide failure | |
| if [ "$(echo "$unsafe_flags" | jq 'length')" -gt 0 ]; then | |
| echo "ERROR: unsafeFlags found in resolved package JSON:" | |
| echo "$unsafe_flags" | jq '.' || true | |
| echo "--- resolved package dump (first 200 lines) ---" | |
| # Print a sample of the authoritative dump (re-run dump-package for the sample) | |
| swift package dump-package | sed -n '1,200p' || true | |
| exit 1 | |
| else | |
| echo "No unsafeFlags in resolved package JSON." | |
| fi |