Skip to content

get wallet server running with Node v25.9.0#8

Open
mike-parkhill wants to merge 6 commits into
masterfrom
feature/mcp-wallet-3
Open

get wallet server running with Node v25.9.0#8
mike-parkhill wants to merge 6 commits into
masterfrom
feature/mcp-wallet-3

Conversation

@mike-parkhill
Copy link
Copy Markdown
Contributor

No description provided.

Comment on lines +51 to +159
name: ${{ inputs.job_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
cache-dependency-path: package-lock.json

- name: Install dependencies (monorepo)
run: npm ci --workspaces

- name: Build shared package
run: npm run build:shared

- name: Build target server
run: ${{ inputs.build_script }}

- name: Run tests
run: ${{ inputs.test_script }}
working-directory: ${{ inputs.test_working_directory }}

- name: Run integration tests
if: inputs.run_integration_tests
run: ${{ inputs.integration_test_script }}
working-directory: ${{ inputs.integration_test_working_directory }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image for scanning
uses: docker/build-push-action@v6
with:
context: .
file: ${{ inputs.dockerfile }}
load: true
tags: ${{ inputs.image_ref }}
build-args: |
BUILD_NUMBER=${{ github.run_number }}

- name: Scan image for HIGH and CRITICAL vulnerabilities
id: trivy_scan
continue-on-error: true
uses: aquasecurity/trivy-action@v0.35.0
with:
image-ref: ${{ inputs.image_ref }}
format: table
output: ${{ inputs.trivy_results_file }}
ignore-unfixed: true
severity: HIGH,CRITICAL
exit-code: '1'

- name: Add Trivy report to job summary
if: always()
run: |
{
echo "## ${{ inputs.trivy_scan_label }}"
echo
if [ "${{ steps.trivy_scan.outcome }}" = "failure" ]; then
echo "**Status:** FAILED (HIGH/CRITICAL vulnerabilities found)"
else
echo "**Status:** PASSED (no HIGH/CRITICAL vulnerabilities found)"
fi
echo
echo "<details><summary>Full Trivy output</summary>"
echo
echo '```text'
cat "${{ inputs.trivy_results_file }}"
echo '```'
echo "</details>"
} >> "$GITHUB_STEP_SUMMARY"

- name: Generate Trivy SARIF report
if: always()
uses: aquasecurity/trivy-action@v0.35.0
with:
image-ref: ${{ inputs.image_ref }}
format: sarif
output: ${{ inputs.trivy_sarif_file }}
ignore-unfixed: true
severity: HIGH,CRITICAL
exit-code: '0'

- name: Upload Trivy SARIF to GitHub Security
id: trivy_sarif_upload
continue-on-error: true
if: always()
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: ${{ inputs.trivy_sarif_file }}
category: ${{ inputs.sarif_category }}

- name: Add SARIF upload status to job summary
if: always() && steps.trivy_sarif_upload.outcome == 'failure'
run: |
echo >> "$GITHUB_STEP_SUMMARY"
echo "## SARIF Upload" >> "$GITHUB_STEP_SUMMARY"
echo >> "$GITHUB_STEP_SUMMARY"
echo "SARIF upload was skipped or failed. GitHub code scanning may not be enabled for this repository." >> "$GITHUB_STEP_SUMMARY"

- name: Fail job if Trivy found HIGH/CRITICAL issues
if: steps.trivy_scan.outcome == 'failure'
run: |
echo "Trivy detected HIGH/CRITICAL vulnerabilities. See job summary and Security tab for details."
exit 1
Comment on lines +21 to +90
name: Build and Publish Image
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: ${{ inputs.docker_image }}
DOCKERFILE: ${{ inputs.dockerfile }}
BUILD_NUMBER_FILE: ${{ inputs.build_number_file }}
SHOULD_PUSH: ${{ inputs.should_push }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Read build number
id: build_number
run: |
if [ -f "${BUILD_NUMBER_FILE}" ]; then
BUILD_NUM=$(cat "${BUILD_NUMBER_FILE}")
echo "Using ${BUILD_NUMBER_FILE}"
else
BUILD_NUM="${{ github.run_number }}"
echo "${BUILD_NUMBER_FILE} not found; using GitHub run number"
fi
echo "build_number=$BUILD_NUM" >> "$GITHUB_OUTPUT"
echo "Build number: $BUILD_NUM"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to DockerHub
if: ${{ env.SHOULD_PUSH == 'true' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKER_IMAGE }}
tags: |
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.target_commitish == github.event.repository.default_branch }}
type=raw,value=${{ steps.build_number.outputs.build_number }}
labels: |
org.opencontainers.image.licenses=LicenseRef-DL-NPL

- name: Build and publish Docker image
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKERFILE }}
push: ${{ env.SHOULD_PUSH == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
sbom: ${{ env.SHOULD_PUSH == 'true' }}
provenance: ${{ env.SHOULD_PUSH == 'true' }}
build-args: |
BUILD_NUMBER=${{ steps.build_number.outputs.build_number }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

- name: Image digest
if: ${{ env.SHOULD_PUSH == 'true' }}
run: echo "Image pushed with digest ${{ steps.docker_build.outputs.digest }}"

- name: Image build only
if: ${{ env.SHOULD_PUSH != 'true' }}
run: echo "Image built without push because workflow_dispatch input 'push' was false"
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants