diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..df6db55 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,88 @@ +name: Bug report +description: Create a bug report +title: "[opencti] Bug title" +labels: [bug] +body: + - type: markdown + attributes: + value: Please be cautious with the sensitive information/logs while filing the issue. + + - type: textarea + id: description + attributes: + label: Describe the bug a clear and concise description of what the bug is. + validations: + required: true + + - type: input + id: helm-version + attributes: + label: What's your helm version? + description: Output of `#~ helm version` + validations: + required: true + + - type: input + id: kubectl-version + attributes: + label: What's your kubectl version? + description: Output of `#~ kubectl version` + validations: + required: true + + - type: input + id: chart-version + attributes: + label: Chart version + description: Enter the version of the chart that you encountered this bug. + validations: + required: true + + - type: textarea + id: explain-bug + attributes: + label: Explain bug + description: Explain what happened. + validations: + required: false + + - type: textarea + id: expected-result + attributes: + label: What you expected to happen? + description: Enter what you expected to happen. + validations: + required: false + + - type: textarea + id: reproduce-bug + attributes: + label: How to reproduce it? + description: Explain step-by-step if is possible. + validations: + required: false + + - type: textarea + id: chart-values + attributes: + label: Enter the changed values of values.yaml? + description: Please enter only values which differ from the defaults. Enter `NONE` if nothing's changed. + placeholder: 'key: value' + validations: + required: false + + - type: textarea + id: helm-command + attributes: + label: Enter the command that you execute when chart failing/misfunctioning + description: Enter the command as-is as how you executed. + placeholder: helm install [RELEASE] opencti/opencti --version [VERSION] -f values.yaml --debug + validations: + required: true + + - type: textarea + id: more-info + attributes: + label: More info + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000..6eae686 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,40 @@ +name: Feature request +description: Suggest an idea to improve this project +title: "[opencti] Feature title" +labels: [enhancement] +body: + - type: markdown + attributes: + value: Thanks for taking the time to fill out this bug report! + + - type: textarea + id: description + attributes: + label: Is your feature request related to a problem? + description: Description of what the problem is. + validations: + required: true + + - type: textarea + id: proposals + attributes: + label: Describe the solution you'd like + description: Description of what you want to happen. + validations: + required: true + + - type: textarea + id: improves + attributes: + label: Describe alternatives you've considered + description: Description of any alternative solutions or features you've considered. If nothing, please enter `NONE` + validations: + required: true + + - type: textarea + id: more-info + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1ef046c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,29 @@ + +#### What this PR does / why we need it: + +#### Which issue this PR fixes +*(optional, in `fixes #(, fixes #, ...)` format, will close that issue when PR gets merged)* + - fixes # + +#### Special notes for your reviewer: + +#### Checklist + +- [ ] [DCO](https://github.com/devops-ia/helm-opencti/blob/main/CONTRIBUTING.md#sign-off-your-work) signed diff --git a/.github/workflows/auto-assign.yaml b/.github/workflows/auto-assign.yaml index f5ee279..9c6a5a6 100644 --- a/.github/workflows/auto-assign.yaml +++ b/.github/workflows/auto-assign.yaml @@ -1,4 +1,4 @@ -name: auto assign +name: Auto assign on: issues: types: [opened] diff --git a/.github/workflows/check_changes.yaml b/.github/workflows/check-changes.yaml similarity index 98% rename from .github/workflows/check_changes.yaml rename to .github/workflows/check-changes.yaml index 8669094..a543699 100644 --- a/.github/workflows/check_changes.yaml +++ b/.github/workflows/check-changes.yaml @@ -2,7 +2,7 @@ name: Check linkedin/cruise-control updates on: schedule: - - cron: '0 0 * * *' + - cron: '0 * * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 23b1a76..ec2cc0f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,8 +1,10 @@ -name: Create default release +name: Create release env: - USER: devopsiaci - REPO: cruise-control + DOCKERHUB_USER: devopsiaci + DOCKERHUB_REPO: cruise-control + GHCR_REGISTRY: ghcr.io + GHCR_REPO: ${{ github.repository }} on: push: @@ -21,9 +23,18 @@ jobs: jdk_version: - 11 - 17 + + permissions: + contents: write + packages: write + id-token: write + attestations: write + steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Read .lastbuild file id: current_tag @@ -31,25 +42,35 @@ jobs: current_tag=$(grep lastTag .lastbuild | cut -d '=' -f 2) echo "current_tag=$current_tag" >> $GITHUB_OUTPUT - - name: Log in to Docker Hub + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + ############## + # DOCKERHUB + ############## + + - name: "[DOCKERHUB] Log in to Docker Hub" uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Build and push Docker image + - name: "[DOCKERHUB] Build and push Docker image" uses: docker/build-push-action@v6 with: context: . push: true - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 build-args: | OPENJDK_VERSION=${{ matrix.jdk_version }} CC_TAG=${{ steps.current_tag.outputs.current_tag }} tags: | - ${{ env.USER }}/${{ env.REPO }}:jdk${{ matrix.jdk_version }}-cc${{ steps.current_tag.outputs.current_tag }} + ${{ env.DOCKERHUB_USER }}/${{ env.DOCKERHUB_REPO }}:jdk${{ matrix.jdk_version }}-cc${{ steps.current_tag.outputs.current_tag }} - - name: Update README.md default version + - name: "[DOCKERHUB] Update README.md default version" run: | # replace default version sed -i "s/\* Cruise Control: .*/* Cruise Control: ${{ steps.current_tag.outputs.current_tag }}/" README.md @@ -59,11 +80,47 @@ jobs: git config --global user.name "github-actions[bot]" git add README.md git commit -m "chore: update README.md [skip ci]" - git push origin HEAD:main + git push -f origin HEAD:main - - name: Update Docker registry description + - name: "[DOCKERHUB] Update Docker registry description" uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: ${{ env.USER }}/${{ env.REPO }} + repository: ${{ env.DOCKERHUB_USER }}/${{ env.DOCKERHUB_REPO }} + + ############## + # GHCR + ############## + + - name: "[GHCR] Log in to the Container registry" + uses: docker/login-action@v3 + with: + registry: ${{ env.GHCR_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: "[GHCR] Get metadata" + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPO }} + + - name: "[GHCR] Build and push Docker image" + id: push + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + build-args: | + OPENJDK_VERSION=${{ matrix.jdk_version }} + CC_TAG=${{ steps.current_tag.outputs.current_tag }} + tags: | + ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPO }}:jdk${{ matrix.jdk_version }}-cc${{ steps.current_tag.outputs.current_tag }} + + - name: "[GHCR] Generate artifact" + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_REPO }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true