gittuf/internal/cmd/addhooks/prepush.go
Pat Zielinski d571facb8d *: Add copyright notice to code files
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2024-09-27 15:28:12 -04:00

25 lines
526 B
Go

// Copyright The gittuf Authors
// SPDX-License-Identifier: Apache-2.0
package addhooks
var prePushScript = []byte(`#!/bin/sh
set -e
remote="$1"
url="$2"
if ! command -v gittuf > /dev/null
then
echo "gittuf could not be found"
echo "Download from: https://github.com/gittuf/gittuf/releases/latest"
exit 1
fi
echo "Pulling RSL from ${remote}."
gittuf rsl remote pull ${remote}
echo "Creating new RSL record for HEAD."
gittuf rsl record HEAD
echo "Pushing RSL to ${remote}."
gittuf rsl remote push ${remote}
`)