Skip to content

Commit

Permalink
Fix issues from new pre-commit check
Browse files Browse the repository at this point in the history
Signed-off-by: John Kjell <[email protected]>
  • Loading branch information
jkjell committed Dec 1, 2023
1 parent 709d418 commit 575bc6b
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 21 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
test:
needs: [fmt, static_analysis]
uses: ./.github/workflows/witness.yml
with:
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: "test"
attestations: "github"
Expand All @@ -66,7 +66,7 @@ jobs:
packages: write
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')

steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand All @@ -77,17 +77,17 @@ jobs:
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.21.x

- name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download GoReleaser
run: go install github.com/goreleaser/goreleaser@latest

- name: Run GoReleaser
uses: testifysec/witness-run-action@40aa4ef36fc431a37de7c3faebcb66513c03b934
env:
Expand All @@ -96,4 +96,4 @@ jobs:
with:
step: "build"
attestations: "github"
command: goreleaser release --clean
command: goreleaser release --clean
4 changes: 2 additions & 2 deletions .github/workflows/witness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
on:
workflow_call:
inputs:
pull_request:
pull_request:
required: true
type: boolean
command:
Expand All @@ -27,7 +27,7 @@ on:
attestations:
required: true
type: string

jobs:
witness:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build-and-push-server:
script:
- ko auth login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- ko publish --bare --tags=${CI_COMMIT_SHORT_SHA} ./cmd/archivista

build-and-push-client:
variables:
KO_DOCKER_REPO: registry.gitlab.com/testifysec/judge-platform/archivista/archivistactl
Expand Down
3 changes: 3 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test/package.attestation.json:generic-api-key:1
test/fail.attestation.json:generic-api-key:1
test/build.attestation.json:generic-api-key:1
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ For answers to common questions about this code of conduct, see the FAQ at
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
|----------------------------|-----------------|
| Cole Kennedy (TestifySec) | [@colek42](https://github.com/colek42) |
| John Kjell (TestifySec) | [@jkjell](https://github.com/jkjell) |
| Mikhail Swift (TestifySec) | [@mikhailswift](https://github.com/mikhailswift) |
| Mikhail Swift (TestifySec) | [@mikhailswift](https://github.com/mikhailswift) |
2 changes: 1 addition & 1 deletion cmd/archivistactl/cmd/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const retrieveSubjectsQuery = `query($gitoid: String!) {
hasDsseWith:{
gitoidSha256: $gitoid
}
}
}
}
) {
edges {
Expand Down
2 changes: 1 addition & 1 deletion cmd/archivistactl/cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const searchQuery = `query($algo: String!, $digest: String!) {
hasStatementWith: {
hasSubjectsWith: {
hasSubjectDigestsWith: {
value: $digest,
value: $digest,
algorithm: $algo
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/build.attestation.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fail.attestation.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/package.attestation.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ checkprograms() {
local result=0
for prog in "$@"
do
if ! command -v $prog > /dev/null; then
printf "$prog is required to run this script. please ensure it is installed and in your PATH\n"
if ! command -v "$prog" > /dev/null; then
print "$prog is required to run this script. please ensure it is installed and in your PATH\n"
result=1
fi
done
Expand All @@ -31,14 +31,15 @@ checkprograms() {
}

runtests() {
go run $DIR/../cmd/archivistactl/main.go store $DIR/*.attestation.json
go run "$DIR/../cmd/archivistactl/main.go store $DIR/*.attestation.json"
}

waitForArchivista() {
echo "Waiting for archivista to be ready..."
for attempt in $(seq 1 6); do
sleep 10
local archivistastate=$(docker compose -f "$DIR/../compose.yml" ps archivista --format json | jq -r '.State')
local archivistastate
archivistastate=$(docker compose -f "$DIR/../compose.yml" ps archivista --format json | jq -r '.State')
if [ "$archivistastate" == "running" ]; then
break
fi
Expand All @@ -64,4 +65,4 @@ echo "Test psql..."
docker compose -f "$DIR/../compose.yml" -f "$DIR/../compose.psql.yml" up --build -d
waitForArchivista
runtests
docker compose -f "$DIR/../compose.yml" -f "$DIR/../compose.psql.yml" down -v
docker compose -f "$DIR/../compose.yml" -f "$DIR/../compose.psql.yml" down -v

0 comments on commit 575bc6b

Please sign in to comment.