Skip to content

Commit cfe0db4

Browse files
authored
Merge branch 'getsops:main' into ISSUE-881
2 parents cd832ea + 6cd7ca1 commit cfe0db4

69 files changed

Lines changed: 1991 additions & 883 deletions

Some content is hidden

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

.dockerignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/dependabot.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "docker"
5+
directory: "/"
6+
labels: ["dependencies"]
7+
schedule:
8+
# By default, this will be on a Monday.
9+
interval: "weekly"
10+
groups:
11+
# Group all updates together, so that they are all applied in a single PR.
12+
# xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
13+
docker:
14+
patterns:
15+
- "*"
16+
17+
- package-ecosystem: "github-actions"
18+
directory: "/"
19+
labels: ["area/CI", "dependencies"]
20+
schedule:
21+
# By default, this will be on a Monday.
22+
interval: "weekly"
23+
groups:
24+
# Group all updates together, so that they are all applied in a single PR.
25+
# xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
26+
ci:
27+
patterns:
28+
- "*"
29+
30+
- package-ecosystem: "gomod"
31+
directory: "/"
32+
labels: ["dependencies"]
33+
schedule:
34+
# By default, this will be on a Monday.
35+
interval: "weekly"
36+
groups:
37+
# Group all updates together, so that they are all applied in a single PR.
38+
# xref: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
39+
go:
40+
patterns:
41+
- "*"

.github/workflows/cli.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ on:
66
- main
77
pull_request:
88
branches:
9-
- main
9+
- main
10+
11+
permissions:
12+
contents: read
1013

1114
jobs:
1215
build:
@@ -24,40 +27,52 @@ jobs:
2427
VAULT_TOKEN: "root"
2528
VAULT_ADDR: "http://127.0.0.1:8200"
2629
steps:
27-
- name: Install dependencies
28-
run: sudo apt-get update && sudo apt-get install git -y
2930
- name: Set up Go 1.20
30-
uses: actions/setup-go@v3
31+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3132
with:
3233
go-version: '1.20'
3334
id: go
35+
3436
- name: Check out code into the Go module directory
35-
uses: actions/checkout@v3
36-
- uses: actions/cache@v3
37+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3.6.0
38+
39+
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
3740
with:
3841
path: ~/go/pkg/mod
3942
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
4043
restore-keys: |
4144
${{ runner.os }}-go-
45+
46+
- name: Vendor Go Modules
47+
run: make vendor
48+
49+
- name: Ensure clean working tree
50+
run: git diff --exit-code
51+
4252
- name: Build Linux and Darwin
4353
if: matrix.os != 'windows'
4454
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o sops-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }} -v ./cmd/sops
55+
4556
- name: Build Windows
4657
if: matrix.os == 'windows'
4758
run: GOOS=${{ matrix.os }} go build -o sops-${{ matrix.os }}-${{ github.sha }} -v ./cmd/sops
59+
4860
- name: Import test GPG keys
4961
run: for i in 1 2 3 4 5; do gpg --import pgp/sops_functional_tests_key.asc && break || sleep 15; done
62+
5063
- name: Test
5164
run: make test
65+
5266
- name: Upload artifact for Linux and Darwin
5367
if: matrix.os != 'windows'
54-
uses: actions/upload-artifact@v3
68+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
5569
with:
5670
name: sops-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}
5771
path: sops-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}
72+
5873
- name: Upload artifact for Windows
5974
if: matrix.os == 'windows'
60-
uses: actions/upload-artifact@v3
75+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
6176
with:
6277
name: sops-${{ matrix.os }}-${{ github.sha }}
6378
path: sops-${{ matrix.os }}-${{ github.sha }}
@@ -72,23 +87,32 @@ jobs:
7287
steps:
7388
- name: Install rustup
7489
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.70.0
90+
7591
- name: Check out code
76-
uses: actions/checkout@v3
77-
- uses: actions/download-artifact@v3
92+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3.6.0
93+
94+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
7895
with:
7996
name: sops-linux-amd64-${{ github.sha }}
97+
8098
- name: Move SOPS binary
8199
run: mv sops-linux-amd64-${{ github.sha }} ./functional-tests/sops
100+
82101
- name: Make SOPS binary executable
83102
run: chmod +x ./functional-tests/sops
103+
84104
- name: Download Vault
85105
run: curl -O "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip" && sudo unzip vault_${VAULT_VERSION}_linux_amd64.zip -d /usr/local/bin/
106+
86107
- name: Start Vault server
87108
run: vault server -dev -dev-root-token-id="$VAULT_TOKEN" &
109+
88110
- name: Enable Vault KV
89111
run: vault secrets enable -version=1 kv
112+
90113
- name: Import test GPG keys
91114
run: for i in 1 2 3 4 5; do gpg --import pgp/sops_functional_tests_key.asc && break || sleep 15; done
115+
92116
- name: Run tests
93117
run: cargo test
94118
working-directory: ./functional-tests

.github/workflows/codeql.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
# Ignore changes to common non-code files.
9+
paths-ignore:
10+
- '**/*.md'
11+
- '**/*.rst'
12+
- '**/*.txt'
13+
- '**/*.yml'
14+
- '**/*.yaml'
15+
- '**/*.json'
16+
- '**/*.ini'
17+
- '**/*.env'
18+
schedule:
19+
- cron: '25 6 * * 3'
20+
21+
jobs:
22+
analyze:
23+
name: Analyze
24+
runs-on: ubuntu-latest
25+
permissions:
26+
actions: read
27+
contents: read
28+
security-events: write
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
33+
34+
# Initializes the CodeQL tools for scanning.
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
37+
with:
38+
languages: go
39+
# xref: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
40+
# xref: https://codeql.github.com/codeql-query-help/go/
41+
queries: security-and-quality
42+
43+
# Build the project, and run CodeQL analysis.
44+
# We do not make use of autobuild as this would run the first Make
45+
# target, which includes a lot more than just the Go files we want to
46+
# scan.
47+
- name: Build
48+
run: make install
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
52+
with:
53+
category: "/language:go"

0 commit comments

Comments
 (0)