mirror of
https://github.com/sbrow/envr.git
synced 2025-12-29 23:47:39 -05:00
Compare commits
6 Commits
v0.1.0
...
463bed1353
| Author | SHA1 | Date | |
|---|---|---|---|
| 463bed1353 | |||
| 9ab72a25fa | |||
| 35519550ed | |||
|
|
7a60c673be | ||
|
|
f8dc85a8b7 | ||
| 5310803c8b |
28
.github/workflows/go.yml
vendored
Normal file
28
.github/workflows/go.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# This workflow will build a golang project
|
||||||
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
||||||
|
|
||||||
|
name: Go
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '1.24.6'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v ./...
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v ./...
|
||||||
25
.github/workflows/release-please.yml
vendored
Normal file
25
.github/workflows/release-please.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
name: release-please
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-please:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: googleapis/release-please-action@v4
|
||||||
|
with:
|
||||||
|
# this assumes that you have created a personal access token
|
||||||
|
# (PAT) and configured it as a GitHub action secret named
|
||||||
|
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
|
||||||
|
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
|
||||||
|
# this is a built-in strategy in release-please, see "Action Inputs"
|
||||||
|
# for more options
|
||||||
|
release-type: go
|
||||||
@@ -88,8 +88,8 @@ The configuration file is created during initialization:
|
|||||||
{
|
{
|
||||||
"keys": [
|
"keys": [
|
||||||
{
|
{
|
||||||
"private": "/home/spencer/.ssh/id_ed25519",
|
"private": "/home/ubuntu/.ssh/id_ed25519",
|
||||||
"public": "/home/spencer/.ssh/id_ed25519.pub"
|
"public": "/home/ubuntu/.ssh/id_ed25519.pub"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scan": {
|
"scan": {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ type scanConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a fresh config with sensible defaults.
|
// Create a fresh config with sensible defaults.
|
||||||
|
// TODO: fd '\.env' -HI ~/ -E '*\.envrc' -E '\.env\.example' -E '\.local/' -E 'vendor' -E 'node_modules'
|
||||||
func NewConfig(privateKeyPaths []string) Config {
|
func NewConfig(privateKeyPaths []string) Config {
|
||||||
var keys = []SshKeyPair{}
|
var keys = []SshKeyPair{}
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ func getGitRemotes(dir string) []string {
|
|||||||
func (file EnvFile) Restore() error {
|
func (file EnvFile) Restore() error {
|
||||||
// TODO: Handle restores more cleanly
|
// TODO: Handle restores more cleanly
|
||||||
// Ensure the directory exists
|
// Ensure the directory exists
|
||||||
if err := os.MkdirAll(filepath.Dir(file.Path), 0755); err != nil {
|
if _, err := os.Stat(file.Dir); err != nil {
|
||||||
return fmt.Errorf("failed to create directory: %w", err)
|
return fmt.Errorf("directory missing")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if file already exists
|
// Check if file already exists
|
||||||
|
|||||||
Reference in New Issue
Block a user