hawdb 0.7.0

An embedded Rust graph database for local data-plane workloads
Documentation
name: Stage HawDB source
description: Stage this pinned HawDB revision for an organization workflow.

inputs:
  path:
    description: Workspace-relative destination for the HawDB source tree.
    required: false
    default: hawdb

outputs:
  revision:
    description: Git revision used to download this private action.
    value: ${{ steps.stage.outputs.revision }}

runs:
  using: composite
  steps:
    - name: Stage source tree
      id: stage
      shell: bash
      env:
        HAWDB_DESTINATION: ${{ inputs.path }}
        HAWDB_SOURCE: ${{ github.action_path }}
        HAWDB_REVISION: ${{ github.action_ref }}
      run: |
        set -euo pipefail
        if [ -e "$HAWDB_DESTINATION" ] && [ ! -d "$HAWDB_DESTINATION" ]; then
          echo "Destination is not a directory: $HAWDB_DESTINATION" >&2
          exit 1
        fi
        if [ -d "$HAWDB_DESTINATION" ] &&
          [ -n "$(find "$HAWDB_DESTINATION" -mindepth 1 -maxdepth 1 -print -quit)" ]; then
          echo "Destination is not empty: $HAWDB_DESTINATION" >&2
          exit 1
        fi
        mkdir -p "$HAWDB_DESTINATION"
        cp -R "$HAWDB_SOURCE"/. "$HAWDB_DESTINATION"/
        echo "revision=$HAWDB_REVISION" >> "$GITHUB_OUTPUT"