diff --git a/.github/workflow/multi-gitter-pr-sync.yml b/.github/workflow/multi-gitter-pr-sync.yml deleted file mode 100644 index 97eb3e184..000000000 --- a/.github/workflow/multi-gitter-pr-sync.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Creating PR using Multi-Gitter - -on: - pull_request: - types: [opened] - branches: - - develop - -jobs: - update-dependencies: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '>=1.17.0' - - - name: Install multi-gitter - run: curl -s https://raw.githubusercontent.com/lindell/multi-gitter/b62a2dfda0ed266502f7c71f7ce79f8fd9c26bf6/install.sh | sh - - - name: Get PR details - env: - HEAD_BRANCH: ${{ github.event.pull_request.head.ref }} - BASE_BRANCH: ${{ github.event.pull_request.base.ref }} - COMMIT_SHA: ${{ github.event.pull_request.head.sha }} - PR_AUTHOR: ${{ github.event.pull_request.user.login }} - PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }} - run: | - echo "HEAD_BRANCH=$HEAD_BRANCH" >> $GITHUB_ENV - echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV - echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV - echo "PR_AUTHOR=$PR_AUTHOR" >> $GITHUB_ENV - echo "PR_AUTHOR_ID=$PR_AUTHOR_ID" >> $GITHUB_ENV - echo "PR_AUTHOR_EMAIL=${PR_AUTHOR_ID}+${PR_AUTHOR}@users.noreply.github.com" >> $GITHUB_ENV - - - name: Update script with PR details - run: | - sed -i 's/VERSION=.*/VERSION=${{ env.COMMIT_SHA }}/' .github/scripts/update-version.sh - - - name: Run multi-gitter - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - chmod +x .github/scripts/update-version.sh - multi-gitter run .github/scripts/update-version.sh --token "$GITEA_TOKEN" --base-branch "$BASE_BRANCH" --branch "$HEAD_BRANCH" --author-name "$PR_AUTHOR" --author-email "$PR_AUTHOR_EMAIL" --pr-title "fix: sync with changes from $HEAD_BRANCH of common-lib" --config .github/config/multi-gitter-config diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 000000000..f4fc8ab10 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,56 @@ +# Workflow name: Go Linter (golangci-lint) +name: Go Linter + +# Trigger the workflow on pull request events +on: + pull_request: + types: [opened, edited, reopened, synchronize] + branches: + - 'main' + - 'rc-*' + - 'hotfix-*' + - 'develop' + +# Set permissions for the GITHUB_TOKEN +permissions: + contents: read # Only read access to the repository contents is needed for linting + +# Define the jobs to run +jobs: + golangci-lint: + name: Lint Go Code + runs-on: ubuntu-latest + strategy: + matrix: + # Define the directories to run linting on + working-directory: [common-lib, authenticator, chart-sync, kubewatch, git-sensor, kubelink, lens] + + steps: + # Step 1: Check out the repository + - name: Check out code + uses: actions/checkout@v4 + + # Step 2: Set up Go environment + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable # Use the latest stable version of Go + + # Step 3: Install dependencies for common-lib (if applicable) + - name: Install common-lib dependencies + if: ${{ matrix.working-directory == 'common-lib' }} + run: | + cd common-lib + go get oras.land/oras-go/pkg/auth/docker + go mod tidy + go mod download + go mod vendor + + # Step 4: Run golangci-lint + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.61 # Specify the version of golangci-lint to use + args: --timeout=30m --tests=false --verbose # Set linting arguments + only-new-issues: "true" # Only report new issues + working-directory: ${{ matrix.working-directory }} # Set the working directory based on the matrix \ No newline at end of file