-
Notifications
You must be signed in to change notification settings - Fork 5
Develop #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #58
Changes from all commits
7b69d55
e24d99b
af8b1bb
321db84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Storage Encryption Key (Optional) | ||
| # If not provided, a secure key will be generated and stored in the device's secure keystore | ||
| # For production, consider using a key management service or environment-specific key | ||
| # RESPOND_STORAGE_ENCRYPTION_KEY=your-256-bit-encryption-key-here | ||
|
|
||
| # API Configuration | ||
| RESPOND_BASE_API_URL=https://qaapi.resgrid.dev | ||
| RESPOND_API_VERSION=v4 | ||
| RESPOND_RESGRID_API_URL=/api/v4 | ||
| RESPOND_CHANNEL_API_URL=https://qaevents.resgrid.dev/ | ||
| RESPOND_CHANNEL_HUB_NAME=eventingHub | ||
| RESPOND_REALTIME_GEO_HUB_NAME=geolocationHub | ||
|
|
||
| # App Configuration | ||
| RESPOND_LOGGING_KEY= | ||
| RESPOND_APP_KEY= | ||
|
|
||
| # Mapbox Configuration | ||
| RESPOND_MAPBOX_PUBKEY= | ||
| RESPOND_MAPBOX_DLKEY= | ||
|
|
||
| # Analytics Configuration | ||
| RESPOND_SENTRY_DSN= | ||
| RESPOND_APTABASE_APP_KEY= | ||
| RESPOND_APTABASE_URL= |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -154,13 +154,15 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
| sudo apt-get update && sudo apt-get install -y jq | ||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||
| androidVersionCode=$((5080345 + ${{ github.run_number }})) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Android Version Code: ${androidVersionCode}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Fix the main entry in package.json | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -f ./package.json ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create a backup | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cp package.json package.json.bak | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Update the package.json | ||||||||||||||||||||||||||||||||||||||||||||||||||
| jq '.version = "7.${{ github.run_number }}"' package.json > package.json.tmp && mv package.json.tmp package.json | ||||||||||||||||||||||||||||||||||||||||||||||||||
| jq '.versionCode = "7${{ github.run_number }}"' package.json > package.json.tmp && mv package.json.tmp package.json | ||||||||||||||||||||||||||||||||||||||||||||||||||
| jq --arg version "10.${{ github.run_number }}" --argjson versionCode "$androidVersionCode" '.version = $version | .versionCode = $versionCode' package.json > package.json.tmp && mv package.json.tmp package.json | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Updated package.json versions" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cat package.json | grep "version" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cat package.json | grep "versionCode" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -273,3 +275,41 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
| file: ./ResgridRespond-ios-adhoc.ipa | ||||||||||||||||||||||||||||||||||||||||||||||||||
| groups: Resgrid | ||||||||||||||||||||||||||||||||||||||||||||||||||
| notify: on | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: 📋 Extract Release Notes from PR Body | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ matrix.platform == 'android' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| PR_BODY: ${{ github.event.pull_request.body }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -eo pipefail | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Grab lines after "## Release Notes" until the next header | ||||||||||||||||||||||||||||||||||||||||||||||||||
| RELEASE_NOTES="$(printf '%s\n' "$PR_BODY" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| | awk 'f && /^## /{f=0} /^## Release Notes/{f=1; next} f')" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Use a unique delimiter to write multiline into GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||||
| delimiter="EOF_$(date +%s)_$RANDOM" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "RELEASE_NOTES<<$delimiter" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "$delimiter" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } >> "$GITHUB_ENV" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+279
to
+295
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid writing PR body into GITHUB_ENV; write directly to a file to eliminate env injection risk. PR bodies are user-controlled on pull_request and workflow_dispatch. Even with a randomized delimiter, writing arbitrary content into GITHUB_ENV is unnecessary here and flagged by CodeQL. Generate the release notes file directly and drop the environment variable. Apply this diff to remove the env write step: - - name: 📋 Extract Release Notes from PR Body
- if: ${{ matrix.platform == 'android' }}
- env:
- PR_BODY: ${{ github.event.pull_request.body }}
- run: |
- set -eo pipefail
- # Grab lines after "## Release Notes" until the next header
- RELEASE_NOTES="$(printf '%s\n' "$PR_BODY" \
- | awk 'f && /^## /{f=0} /^## Release Notes/{f=1; next} f')"
- # Use a unique delimiter to write multiline into GITHUB_ENV
- delimiter="EOF_$(date +%s)_$RANDOM"
- {
- echo "RELEASE_NOTES<<$delimiter"
- printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}"
- echo "$delimiter"
- } >> "$GITHUB_ENV"
🧰 Tools🪛 GitHub Check: CodeQL[failure] 283-294: Environment variable built from user-controlled sources Grab lines after "## Release Notes" until the next headerRELEASE_NOTES="$(printf '%s\n' "$PR_BODY" \ Use a unique delimiter to write multiline into GITHUB_ENVdelimiter="EOF_$(date +%s)_$RANDOM" 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: 📋 Prepare Release Notes file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ matrix.platform == 'android' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "## Version 10.${{ github.run_number }} - $(date +%Y-%m-%d)" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo | ||||||||||||||||||||||||||||||||||||||||||||||||||
| printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } > RELEASE_NOTES.md | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+296
to
+304
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Build the RELEASE_NOTES.md directly (no dependency on env state). Inline the extraction in this step and write the file directly. - - name: 📋 Prepare Release Notes file
- if: ${{ matrix.platform == 'android' }}
- run: |
- {
- echo "## Version 10.${{ github.run_number }} - $(date +%Y-%m-%d)"
- echo
- printf '%s\n' "${RELEASE_NOTES:-No release notes provided.}"
- } > RELEASE_NOTES.md
+ - name: 📋 Prepare Release Notes file
+ if: ${{ matrix.platform == 'android' }}
+ env:
+ PR_BODY: ${{ github.event.pull_request.body }}
+ run: |
+ set -eo pipefail
+ NOTES="$(printf '%s\n' "$PR_BODY" | awk 'f && /^## /{f=0} /^## Release Notes/{f=1; next} f')"
+ {
+ echo "## Version 10.${{ github.run_number }} - $(date +%Y-%m-%d)"
+ echo
+ if [ -n "$NOTES" ]; then
+ printf '%s\n' "$NOTES"
+ else
+ echo "No release notes provided."
+ fi
+ } > RELEASE_NOTES.md📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: 📦 Create Release | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ matrix.platform == 'android' && (github.event.inputs.buildType == 'all' || github.event_name == 'push' || github.event.inputs.buildType == 'prod-apk') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ncipollo/release-action@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| tag: '10.${{ github.run_number }}' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| commit: ${{ github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| makeLatest: true | ||||||||||||||||||||||||||||||||||||||||||||||||||
| allowUpdates: true | ||||||||||||||||||||||||||||||||||||||||||||||||||
| name: '10.${{ github.run_number }}' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| artifacts: './ResgridRespond-prod.apk' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| bodyFile: 'RELEASE_NOTES.md' | ||||||||||||||||||||||||||||||||||||||||||||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| module.exports = require('react-native-gesture-handler/src/mocks.js'); | ||
| module.exports = require('react-native-gesture-handler/lib/commonjs/mocks.js'); |
This file was deleted.
Check failure
Code scanning / CodeQL
Environment variable built from user-controlled sources Critical
Copilot Autofix
AI 5 months ago
To fix the problem, we must ensure that user-controlled data (the PR body) cannot inject new environment variables or break out of the intended assignment in the
$GITHUB_ENVfile. The best way to do this is:uuidgenif available) to make delimiter collision practically impossible.In this case, the best fix is to use
uuidgento generate a strong, unique delimiter, and to check that the delimiter does not appear in the release notes before writing to$GITHUB_ENV. Ifuuidgenis not available, fall back to the current method, but still check for delimiter collisions.Required changes:
uuidgenif available.