Skip to content

Commit ad8361b

Browse files
committed
Merge branch 'main' into amanda/cratedb
2 parents 257177a + 00a6fca commit ad8361b

132 files changed

Lines changed: 3817 additions & 196 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: true
22
contact_links:
33
- name: "💬 Chat with us on Slack"
4-
url: https://join.slack.com/t/1password-devs/shared_invite/zt-1halo11ps-6o9pEv96xZ3LtX_VE0fJQA
4+
url: https://developer.1password.com/joinslack
55
about: Chat with us about shell plugins in our Developer Slack workspace.
66
- name: "❓ General 1Password questions"
77
url: https://1password.community

.github/workflows/check-flake.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check Nix flake
2+
on:
3+
pull_request:
4+
paths:
5+
- "**.nix"
6+
- flake.lock
7+
push:
8+
branches:
9+
- main
10+
jobs:
11+
check-flake:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: DeterminateSystems/nix-installer-action@v22
16+
- uses: DeterminateSystems/magic-nix-cache-action@v13
17+
- name: Check Nix flake inputs
18+
uses: DeterminateSystems/flake-checker-action@v5
19+
with:
20+
fail-mode: true
21+
send-statistics: false
22+
- name: Run nix flake check
23+
run: nix flake check

.github/workflows/pr-check-signed-commits.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@ jobs:
99
pull-requests: write
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Check out code
13-
uses: actions/checkout@v3
14-
1512
- name: Check signed commits in PR
16-
uses: 1Password/check-signed-commits-action@v1
13+
uses: 1Password/check-signed-commits-action@main

.github/workflows/test.yaml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ name: Test and Validate
22
on:
33
push:
44
paths-ignore:
5-
- '**.md'
6-
- '.github/ISSUE_TEMPLATE/**'
5+
- "**.md"
6+
- ".github/ISSUE_TEMPLATE/**"
77
pull_request:
88
paths-ignore:
9-
- '**.md'
10-
- '.github/ISSUE_TEMPLATE/**'
9+
- "**.md"
10+
- ".github/ISSUE_TEMPLATE/**"
1111

1212
jobs:
1313
build:
1414
name: Test
1515
runs-on: ubuntu-latest
1616
steps:
17+
- name: Check out code into the Go module directory
18+
uses: actions/checkout@v6
19+
1720
- name: Set up Go 1.x
18-
uses: actions/setup-go@v3
21+
uses: actions/setup-go@v6
1922
with:
2023
go-version: ^1.18
2124

22-
- name: Check out code into the Go module directory
23-
uses: actions/checkout@v3
24-
2525
- name: Test
2626
run: make test
2727

@@ -31,16 +31,17 @@ jobs:
3131
name: Lint
3232
runs-on: ubuntu-latest
3333
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v6
36+
3437
- name: "Set up Go 1.x"
35-
uses: actions/setup-go@v3
38+
uses: actions/setup-go@v6
3639
with:
3740
go-version: 1.19
3841

39-
- name: Check out code
40-
uses: actions/checkout@v3
41-
42-
- name: Lint with golanci-lint
43-
uses: golangci/golangci-lint-action@v3
42+
- name: Lint with golangci-lint
43+
uses: golangci/golangci-lint-action@v9
4444
with:
4545
# version of golangci-lint to use
46-
version: v1.50.1
46+
# Version should stay in sync with version used for local linting (lint job in Makefile).
47+
version: v2.12.2
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# CI job to periodically (once a week) update flake.lock
2+
name: Update flake dependencies
3+
on:
4+
schedule:
5+
- cron: "0 16 * * 5"
6+
workflow_dispatch: # for allowing manual triggers of the workflow
7+
jobs:
8+
update-dependencies:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v6
12+
- uses: DeterminateSystems/nix-installer-action@v22
13+
- uses: DeterminateSystems/magic-nix-cache-action@v13
14+
with:
15+
use-flakehub: false
16+
- name: Update flake.lock and create signed commit with flake.lock changes
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.OP_BOT_TOKEN }}
19+
FILE_TO_COMMIT: flake.lock
20+
COMMIT_BRANCH: automation/update-flake-dependencies
21+
COMMIT_MESSAGE: "chore(nix): Update Flake dependencies"
22+
run: |
23+
# fetch remote state
24+
git fetch
25+
# if branch exists on remote already
26+
BRANCH_EXISTS=false
27+
if git checkout "$COMMIT_BRANCH" > /dev/null 2>&1; then
28+
# pull changeshttps://github.com/1Password/shell-plugins/pull/595
29+
git pull
30+
BRANCH_EXISTS=true
31+
else
32+
# otherwise, create the branch and push it to remote
33+
git checkout -b "$COMMIT_BRANCH"
34+
git push -u origin "$COMMIT_BRANCH"
35+
fi
36+
# update flake.lock
37+
nix flake update
38+
# make sure something actually changed first, if not, no updates required
39+
if [[ `git status --porcelain` ]]; then
40+
# commit via the GitHub API so we get automatic commit signing
41+
gh api --method PUT /repos/1Password/shell-plugins/contents/$FILE_TO_COMMIT \
42+
--field message="$COMMIT_MESSAGE" \
43+
--field content="$(base64 -w 0 $FILE_TO_COMMIT)" \
44+
--field branch="$COMMIT_BRANCH" \
45+
--field sha="$(git rev-parse $COMMIT_BRANCH:$FILE_TO_COMMIT)"
46+
if [ "$BRANCH_EXISTS" = "false" ]; then
47+
gh pr create --title "[automation]: Update Flake dependencies" \
48+
--body "This is an automated PR to update \`flake.lock\`" \
49+
--label "flake.lock automation" \
50+
--reviewer mrjones2014 \
51+
--base main --head $COMMIT_BRANCH
52+
fi
53+
fi

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Auto-generated with `make registry`
22
plugins/plugins.go
33

4+
# Auto-generated with `make registry.json`
5+
plugins/registry.json
6+
47
# GoLand
58
.idea
69

@@ -16,3 +19,7 @@ plugins/plugins.go
1619

1720
# 1Password
1821
.op
22+
23+
# direnv
24+
.direnv
25+
.envrc

.golangci.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1+
version: "2"
12
linters:
2-
disable-all: true
3+
default: none
34
enable:
45
# Defaults:
56
- errcheck
6-
- gosimple
77
- govet
88
- ineffassign
9-
- staticcheck
10-
- typecheck
119
- unused
1210
# Extra:
1311
- asciicheck
1412
- bidichk
1513
- depguard
16-
- goimports
17-
- gofmt
14+
- staticcheck
1815

19-
linters-settings:
20-
depguard:
21-
list-type: blacklist
22-
include-go-root: false
23-
packages:
24-
- math/rand
25-
packages-with-error-message:
26-
- math/rand: "please use the safer crypto/rand"
16+
settings:
17+
depguard:
18+
rules:
19+
main:
20+
deny:
21+
- pkg: math/rand
22+
desc: "please use the safer crypto/rand"
23+
24+
formatters:
25+
enable:
26+
- gofmt
27+
- goimports

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ No documentation work is required on your end. If your plugin is accepted, a tec
100100
If you need help, found a bug, or have an idea for an awesome plugin that you'd like to discuss with us first, you can reach out to us here:
101101

102102
* Create an [issue](https://github.com/1Password/shell-plugins/issues) in this repo.
103-
* Join the [Developer Slack workspace](https://join.slack.com/t/1password-devs/shared_invite/zt-1halo11ps-6o9pEv96xZ3LtX_VE0fJQA).
103+
* Join the [Developer Slack workspace](https://developer.1password.com/joinslack).
104104

105105
## 📣 Contributions Beta Notice
106106

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ registry:
2525
validate: registry
2626
go run cmd/contrib/main.go $@
2727

28+
registry.json: registry
29+
go run cmd/contrib/main.go $@
30+
2831
$(plugins_dir):
2932
mkdir -p $(plugins_dir)
3033
chmod 700 $(plugins_dir)
@@ -39,6 +42,10 @@ $(plugins_dir):
3942
test:
4043
go test ./...
4144

45+
lint:
46+
# Version used should stay in sync with version in CI (.github/workflows/test.yaml).
47+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v2.12.2 golangci-lint run
48+
4249
%/remove-local: beta-notice
4350
$(eval plugin := $(firstword $(subst /, ,$@)))
4451
rm -f ~/.op/plugins/local/$(plugin)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ make new-plugin
6161

6262
Still not sure where or how to begin? We're happy to help! You can:
6363
- Book a free [pairing session](https://calendly.com/d/grs-x2h-pmb/1password-shell-plugins-pairing-session) with one of our developers
64-
- Join the [Developer Slack workspace](https://join.slack.com/t/1password-devs/shared_invite/zt-1halo11ps-6o9pEv96xZ3LtX_VE0fJQA), and ask us any questions there
64+
- Join the [Developer Slack workspace](https://developer.1password.com/joinslack), and ask us any questions there
6565

6666
## 💙 Community & Support
6767

6868
- File an [issue](https://github.com/1Password/shell-plugins/issues/new/choose) for bugs and feature requests
69-
- Join the [Developer Slack workspace](https://join.slack.com/t/1password-devs/shared_invite/zt-1halo11ps-6o9pEv96xZ3LtX_VE0fJQA)
69+
- Join the [Developer Slack workspace](https://developer.1password.com/joinslack)
7070
- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/)

0 commit comments

Comments
 (0)