diff --git a/.github/workflows/auto-assign.yaml b/.github/workflows/auto-assign.yaml new file mode 100644 index 00000000..54fc1e18 --- /dev/null +++ b/.github/workflows/auto-assign.yaml @@ -0,0 +1,22 @@ +name: Assign issue to contributor +on: + issue_comment: + types: [created, edited] + +permissions: + contents: read + +jobs: + assign: + permissions: + # write permissions are needed to assign the issue. + issues: write + name: Run self assign job + runs-on: ubuntu-latest + steps: + - name: take the issue + uses: bdougie/take-action@1439165ac45a7461c2d89a59952cd7d941964b87 # main + with: + message: Thanks for taking this issue! Let us know if you have any questions! + trigger: /assign + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dependency-review.yaml b/.github/workflows/dependency-review.yaml new file mode 100644 index 00000000..b9d6d20f --- /dev/null +++ b/.github/workflows/dependency-review.yaml @@ -0,0 +1,14 @@ +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v4 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 43209ec4..6799ffa9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -103,3 +103,16 @@ jobs: ignore_paths: 'vendor' disable_matcher: false format: gcc + + modcheck: + name: modcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - name: run mod check + run: make mod.check diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 00000000..37f893ef --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,46 @@ +# Mark or close stale issues and PRs +# based on the rook workflow: +# https://github.com/rook/rook/blob/master/.github/workflows/stale.yaml + +name: "Mark or close stale issues and PRs" +on: + schedule: + # Run the stalebot every day at 8pm UTC + - cron: "00 20 * * *" + +permissions: + contents: read + +jobs: + stale: + permissions: + issues: write # for actions/stale to close stale issues + pull-requests: write # for actions/stale to close stale PRs + runs-on: ubuntu-22.04 + if: github.repository == 'ceph/ceph-csi-operator' + steps: + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 60 + days-before-pr-stale: 30 + days-before-close: 7 + days-before-pr-close: 14 + stale-issue-message: > + This issue has been automatically marked as stale because it has not had recent activity. + It will be closed in a week if no further activity occurs. + Thank you for your contributions. + stale-pr-message: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed in two weeks if no further activity occurs. + Thank you for your contributions. + close-issue-message: > + This issue has been automatically closed due to inactivity. + Please re-open if this still requires investigation. + close-pr-message: > + This pull request has been automatically closed due to inactivity. + Please re-open if these changes are still required. + stale-pr-label: "stale" + stale-issue-label: "wontfix" + exempt-issue-labels: "keepalive,security,reliability" + exempt-pr-labels: "keepalive,security,reliability" diff --git a/Makefile b/Makefile index 352de97d..3fef1fda 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,14 @@ fmt: ## Run go fmt against code. vet: ## Run go vet against code. go vet ./... +.PHONY: mod.check +mod.check:#check go module dependencies + @echo 'running "go mod verify"' + @go mod verify + @echo 'checking for modified files.' + # fail in case there are uncommitted changes + @ git diff --quiet || (echo "files were modified: " ; git status --porcelain ; false) + .PHONY: test test: manifests generate fmt vet envtest ## Run tests. OPERATOR_NAMESPACE="$${OPERATOR_NAMESPACE:=$(NAMESPACE)}" KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out