Skip to content

Commit

Permalink
updated linting error message
Browse files Browse the repository at this point in the history
Signed-off-by: bishal7679 <bishalhnj127@gmail.com>
  • Loading branch information
bishal7679 committed Jun 25, 2024
1 parent d045132 commit 43510cf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 53 deletions.
46 changes: 3 additions & 43 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
tags:
- "v*"
branches: [dagger-cicd]
branches: [main]

permissions:
contents: write
Expand All @@ -19,52 +19,12 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
go-version: "1.22"
cache: true

- name: Run Dagger Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: go run ci/release.go release ${{ env.GITHUB_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Check for existing SBOM
id: check_sbom
uses: actions/github-script@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const { data: { assets } } = await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', '')
});
const sbomExists = assets.some(asset => asset.name === `harbor_${context.ref.replace('refs/tags/', '')}.sbom`);
return sbomExists;
- name: Upload SBOM
if: steps.check_sbom.outputs.sbomExists == 'false'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: path/to/harbor_{{ github.ref }}.sbom
asset_name: harbor_${{ github.ref }}.sbom
asset_content_type: application/vnd.ms-spdx+json
run: go run ci/release.go release ${{ env.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
go-version: "1.22"
cache: true

- name: Run Dagger Pull Request
Expand Down
2 changes: 0 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ nfpms:

sboms:
- artifacts: archive
documents:
- "harbor_{{.Tag}}_.sbom"

checksum:
name_template: 'checksums.txt'
Expand Down
5 changes: 2 additions & 3 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ func lint(ctx context.Context) error {
golangciLintCont = golangciLintCont.WithExec([]string{"golangci-lint", "run", "--timeout", "5m"})

_, err = golangciLintCont.Stderr(ctx)
if err != nil {
return fmt.Errorf("linting failed 😢: %w", err)
if err == nil {
fmt.Println("LINT COMPLETED!✅")
}
fmt.Println("LINT COMPLETED!✅")
return nil
}

Expand Down
4 changes: 4 additions & 0 deletions dagger/dagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "dagger",
"engineVersion": "v0.9.10"
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/goharbor/harbor-cli

go 1.21
go 1.22.2

require (
github.com/charmbracelet/bubbles v0.18.0
Expand Down
6 changes: 3 additions & 3 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
go 1.21.4
go 1.22.2

use (
./ci
.
.
./ci
)

0 comments on commit 43510cf

Please sign in to comment.