From 6e93c0b37b7875eaeb1bdb65c1e67c38d1e73d94 Mon Sep 17 00:00:00 2001 From: "bloopy-boi[bot]" <98279278+bloopy-boi[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:09:10 +0000 Subject: [PATCH 01/11] chore(docker-image): update gcr.io/distroless/static docker digest to 7e5c6a2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 15b1971..28df89a 100755 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN go mod download RUN go build -ldflags="-w -s" . RUN echo $(ls .) -FROM gcr.io/distroless/static@sha256:072d78bc452a2998929a9579464e55067db4bf6d2c5f9cde582e33c10a415bd1 +FROM gcr.io/distroless/static@sha256:7e5c6a2a4ae854242874d36171b31d26e0539c98fc6080f942f16b03e82851ab COPY --from=build /build/bloopyboi / From 90025d1c59c7f500705414885e57c75e412ec140 Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Wed, 13 Mar 2024 21:31:13 -0400 Subject: [PATCH 02/11] linting fixes --- bot/services/media_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/services/media_service.go b/bot/services/media_service.go index de542af..2be5428 100755 --- a/bot/services/media_service.go +++ b/bot/services/media_service.go @@ -70,12 +70,12 @@ func (s *MediaService) GetMediaRequestsForUser(ctx context.Context, discordUserI WithBook(). Where( mediarequest.HasDiscordUsersWith( - discorduser.DiscordidEQ(string(discordUserId)), + discorduser.DiscordidEQ(fmt.Sprint(discordUserId)), ), ). All(ctx) if err != nil { - return nil, fmt.Errorf("failed to get book requests for discord user %s: %w", discordUserId, err) + return nil, fmt.Errorf("failed to get book requests for discord user %d: %w", discordUserId, err) } return requests, nil } From 8725c240f634ec4a478e5517a45a9aff2d725982 Mon Sep 17 00:00:00 2001 From: "bloopy-boi[bot]" <98279278+bloopy-boi[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 02:13:51 +0000 Subject: [PATCH 03/11] ci(github-action): update renovatebot/github-action action to v40.1.5 (#186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [renovatebot/github-action](https://togithub.com/renovatebot/github-action) | action | patch | `v40.1.4` -> `v40.1.5` | --- ### Release Notes
renovatebot/github-action (renovatebot/github-action) ### [`v40.1.5`](https://togithub.com/renovatebot/github-action/releases/tag/v40.1.5) [Compare Source](https://togithub.com/renovatebot/github-action/compare/v40.1.4...v40.1.5) ##### Miscellaneous Chores - **deps:** update dependency [@​types/node](https://togithub.com/types/node) to v20.11.25 ([0af5e4e](https://togithub.com/renovatebot/github-action/commit/0af5e4e8d5730e847e79b6ba783f97967d09326f)) ##### Build System - **deps:** update dependency typescript to v5.4.2 ([e3c8e2c](https://togithub.com/renovatebot/github-action/commit/e3c8e2cd356bb231f8fa193db1722695e8410e16)) ##### Continuous Integration - **deps:** update renovate docker tag to v37.235.5 ([b77198b](https://togithub.com/renovatebot/github-action/commit/b77198bb59663821f3f84f088dae236960f37463)) - **deps:** update renovate docker tag to v37.236.0 ([caabd0f](https://togithub.com/renovatebot/github-action/commit/caabd0fbcfbb3a812e50ae8b7f6568bf9d2bb609)) - **deps:** update renovate docker tag to v37.240.1 ([042c7eb](https://togithub.com/renovatebot/github-action/commit/042c7ebbf2f3bb8cfa71637c4f01b26a9962e90a)) - **deps:** update renovate docker tag to v37.241.0 ([4c3342e](https://togithub.com/renovatebot/github-action/commit/4c3342eacee1952b9a72afea7f44e4eae029b9fa))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). Co-authored-by: bloopy-boi[bot] <98279278+bloopy-boi[bot]@users.noreply.github.com> --- .github/workflows/run-renovate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-renovate.yaml b/.github/workflows/run-renovate.yaml index dc23aed..a0915da 100755 --- a/.github/workflows/run-renovate.yaml +++ b/.github/workflows/run-renovate.yaml @@ -50,7 +50,7 @@ token: "${{ steps.app-token.outputs.token }}" - name: Renovate - uses: renovatebot/github-action@v40.1.4 + uses: renovatebot/github-action@v40.1.5 env: LOG_LEVEL: ${{ inputs.renovateLogLevel }} RENOVATE_DRY_RUN: ${{ inputs.dryRun }} From 8983f7a202987d874c09b3f371f1cba896429ab0 Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Thu, 14 Mar 2024 19:19:47 -0400 Subject: [PATCH 04/11] workflow updates --- .github/actions/tests/action.yaml | 2 +- .github/renovate.json5 | 11 +- .github/workflows/charts-lint.yaml | 88 -------------- .github/workflows/charts-release-oci.yaml | 62 ---------- .github/workflows/charts-release.yaml | 72 ------------ .github/workflows/charts-test.yaml | 137 ---------------------- .vscode/settings.json | 9 ++ 7 files changed, 14 insertions(+), 367 deletions(-) delete mode 100755 .github/workflows/charts-lint.yaml delete mode 100755 .github/workflows/charts-release-oci.yaml delete mode 100755 .github/workflows/charts-release.yaml delete mode 100755 .github/workflows/charts-test.yaml diff --git a/.github/actions/tests/action.yaml b/.github/actions/tests/action.yaml index a4474e3..6fb4223 100755 --- a/.github/actions/tests/action.yaml +++ b/.github/actions/tests/action.yaml @@ -10,7 +10,7 @@ runs: with: go-version: ">=1.21" - - name: Tidy + - name: Verify Tidiness shell: bash run: | go version diff --git a/.github/renovate.json5 b/.github/renovate.json5 index aa35e96..25eb1b3 100755 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,7 +1,7 @@ -{ +{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base", + "config:recommended", ":dependencyDashboard", ":disableRateLimiting", "docker:enableMajor", @@ -9,11 +9,10 @@ ":automergeDigest", ":enablePreCommit", ":gomod", - //"github>h3mmy/renovate-config:commit-message", "github>h3mmy/renovate-config:pr-labels", "github>h3mmy/renovate-config:semantic-commits", "github>h3mmy/renovate-config:generic-regex-manager", - "github>h3mmy/renovate-config:automerge-github-actions" + "github>h3mmy/renovate-config:automerge-github-actions", ], "onboarding": false, "requireConfig": "optional", @@ -22,7 +21,5 @@ "suppressNotifications": ["prIgnoreNotification"], "commitBodyTable": true, "rebaseWhen": "conflicted", - "postUpdateOptions": [ - "goModTidy", "gomodNoMassage" - ] + "postUpdateOptions": ["gomodTidy"], } diff --git a/.github/workflows/charts-lint.yaml b/.github/workflows/charts-lint.yaml deleted file mode 100755 index f0928f7..0000000 --- a/.github/workflows/charts-lint.yaml +++ /dev/null @@ -1,88 +0,0 @@ -name: "Charts: Lint" - -on: - workflow_call: - inputs: - checkoutCommit: - required: true - type: string - isRenovatePR: - required: true - default: "false" - type: string - chartsToLint: - description: > - A JSON encoded array of charts to lint - required: true - type: string - overrideDeps: - description: > - A JSON encoded array of dependencies to override before linting - type: string - required: false - default: "[]" - -env: - HELM_VERSION: 3.11.2 - -jobs: - lint-chart: - if: ${{ inputs.chartsToLint != '[]' }} - name: Lint chart - strategy: - matrix: - chart: ${{ fromJSON(inputs.chartsToLint) }} - fail-fast: false - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - fetch-depth: 0 - ref: ${{ inputs.checkoutCommit }} - - - name: Verify chart version - uses: bjw-s/helm-charts-actions/verify-chart-version@main - id: verify-chart-version - with: - chart: "charts/${{ matrix.chart }}" - - - name: Verify chart changelog - uses: bjw-s/helm-charts-actions/verify-chart-changelog@main - if: inputs.isRenovatePR != 'true' - id: verify-chart-changelog - with: - chart: "charts/${{ matrix.chart }}" - - - name: Install Kubernetes tools - uses: yokawasa/action-setup-kube-tools@v0.11.0 - with: - setup-tools: | - helmv3 - helm: "${{ env.HELM_VERSION }}" - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.6.1 - - - name: Override chart dependencies - uses: ./.github/actions/override-chart-deps - if: ${{ inputs.overrideDeps != '[]' }} - with: - chart: ${{ matrix.chart }} - overrides: ${{ inputs.overrideDeps }} - - - name: Run chart-testing (lint) - run: ct lint --config .ci/ct/ct.yaml --charts "charts/${{ matrix.chart }}" - - # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 - lint_success: - needs: - - lint-chart - if: | - always() - name: Lint successful - runs-on: ubuntu-22.04 - steps: - - name: Check lint matrix status - if: ${{ (inputs.chartsToLint != '' && inputs.chartsToLint != '[]') && (needs.lint-chart.result != 'success') }} - run: exit 1 diff --git a/.github/workflows/charts-release-oci.yaml b/.github/workflows/charts-release-oci.yaml deleted file mode 100755 index e0f5f3a..0000000 --- a/.github/workflows/charts-release-oci.yaml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: "Charts: Release to GHCR OCI" - -on: - workflow_call: - inputs: - charts: - description: > - Json encoded list of Helm charts to release. - Defaults to releasing everything. - default: "[]" - required: false - type: string - secrets: - APP_ID: - required: true - APP_PRIVATE_KEY: - required: true - -env: - HELM_VERSION: 3.11.2 - CHARTS_SRC_DIR: "charts" - TARGET_REGISTRY: ghcr.io - -jobs: - release-charts: - name: Release charts - runs-on: ubuntu-22.04 - steps: - - name: Checkout chart sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - fetch-depth: 0 - - - name: Install Kubernetes tools - uses: yokawasa/action-setup-kube-tools@v0.11.0 - with: - setup-tools: | - helmv3 - helm: "${{ env.HELM_VERSION }}" - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.TARGET_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Package & Push Helm Charts - shell: bash - run: | - CHARTS=( $(yq --null-input e '${{ inputs.charts }}[]' ) ) - - for CHART in "${CHARTS[@]}" ; do - mapfile -t CHART_PATH_PARTS < <(echo "$CHART" | tr '/' '\n') - CHART_TYPE=${CHART_PATH_PARTS[0]} - CHART_NAME=${CHART_PATH_PARTS[1]} - CHART_VERSION=$(yq e '.version' ${{ env.CHARTS_SRC_DIR }}/${CHART}/Chart.yaml) - - helm package "${{ env.CHARTS_SRC_DIR }}/${CHART_TYPE}/${CHART_NAME}" --dependency-update --destination "${{ env.CHARTS_SRC_DIR }}/${CHART_TYPE}" --version "${CHART_VERSION}" - helm push "${{ env.CHARTS_SRC_DIR }}/${CHART_TYPE}/${CHART_NAME}-${CHART_VERSION}.tgz" oci://${{ env.TARGET_REGISTRY }}/${{ github.actor }}/helm - done diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml deleted file mode 100755 index 905cf8d..0000000 --- a/.github/workflows/charts-release.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- -name: "Charts: Release" - -concurrency: helm-release - -on: - workflow_dispatch: - inputs: - charts: - description: > - Charts to release. Comma-separated string. - Defaults to releasing everything. - default: "" - required: false - - push: - branches: - - main - paths: - - "charts/**" - -env: - HELM_VERSION: 3.11.2 - -jobs: - prepare: - name: Prepare data required for release - runs-on: ubuntu-22.04 - outputs: - libraryChartsToRelease: ${{ steps.collect-charts.outputs.chartsLibrary }} - applicationChartsToRelease: ${{ steps.collect-charts.outputs.chartsApplication }} - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - fetch-depth: 0 - - - name: Collect charts to release - uses: bjw-s/helm-charts-actions/collect-charts@main - id: collect-charts - with: - repoConfigFile: ./.ci/repo-config.yaml - overrideCharts: "[${{ inputs.charts }}]" - - release-library-charts: - name: Release Library charts to GitHub pages - uses: ./.github/workflows/charts-release-ghpages.yaml - needs: - - prepare - with: - charts: "${{ needs.prepare.outputs.libraryChartsToRelease }}" - secrets: inherit - - release-application-charts: - name: Release Application charts to GitHub pages - uses: ./.github/workflows/charts-release-ghpages.yaml - needs: - - prepare - - release-library-charts - with: - charts: "${{ needs.prepare.outputs.applicationChartsToRelease }}" - secrets: inherit - - release-github-oci: - name: Release Application charts to GitHub Container Registry - uses: ./.github/workflows/charts-release-oci.yaml - needs: - - prepare - - release-library-charts - with: - charts: "${{ needs.prepare.outputs.applicationChartsToRelease }}" - secrets: inherit diff --git a/.github/workflows/charts-test.yaml b/.github/workflows/charts-test.yaml deleted file mode 100755 index fd16cdc..0000000 --- a/.github/workflows/charts-test.yaml +++ /dev/null @@ -1,137 +0,0 @@ ---- -name: "Charts: Test" - -on: - workflow_call: - inputs: - checkoutCommit: - required: true - type: string - chartsToTest: - description: > - A JSON encoded array of charts to lint - type: string - required: true - overrideDeps: - description: > - A JSON encoded array of dependencies to override before testing - type: string - required: false - default: "[]" - -env: - HELM_VERSION: 3.11.2 - -jobs: - install-chart: - name: Install chart - runs-on: ubuntu-22.04 - if: ${{ inputs.chartsToTest != '[]' && inputs.chartsToTest != '' }} - strategy: - matrix: - chart: ${{ fromJSON(inputs.chartsToTest) }} - k8s_version: - ["v1.24.13", "v1.25.9", "v1.26.4", "v1.27.1", "v1.28.3"] - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - fetch-depth: 0 - ref: ${{ inputs.checkoutCommit }} - - - name: Install Kubernetes tools - uses: yokawasa/action-setup-kube-tools@v0.11.0 - with: - setup-tools: | - helmv3 - kubectl - helm: "${{ env.HELM_VERSION }}" - kubectl: "${{ matrix.k8s_version }}" - - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.6.1 - - - name: Create k3d cluster - uses: nolar/setup-k3d-k3s@v1 - with: - version: ${{ matrix.k8s_version }} - - - name: Remove node taints - run: | - kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true - - - name: Override chart dependencies - uses: ./.github/actions/override-chart-deps - if: ${{ inputs.overrideDeps != '[]' }} - with: - chart: ${{ matrix.chart }} - overrides: ${{ inputs.overrideDeps }} - - - name: Run chart-testing (install) - run: ct install --config .ci/ct/ct.yaml --charts "charts/${{ matrix.chart }}" - - # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 - install_success: - needs: - - install-chart - if: | - always() - name: Install successful - runs-on: ubuntu-22.04 - steps: - - name: Check install matrix status - if: ${{ (inputs.chartsToTest != '[]' && inputs.chartsToTest != '') && needs.install-chart.result != 'success' }} - run: exit 1 - - unittest-chart: - name: Unit-test chart - runs-on: ubuntu-22.04 - if: ${{ inputs.chartsToTest != '[]' && inputs.chartsToTest != '' }} - strategy: - matrix: - chart: ${{ fromJSON(inputs.chartsToTest) }} - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - fetch-depth: 0 - ref: ${{ inputs.checkoutCommit }} - - - name: Install Kubernetes tools - uses: yokawasa/action-setup-kube-tools@v0.11.0 - with: - setup-tools: | - helmv3 - helm: "${{ env.HELM_VERSION }}" - - - name: Override chart dependencies - uses: ./.github/actions/override-chart-deps - if: ${{ inputs.overrideDeps != '[]' }} - with: - chart: ${{ matrix.chart }} - overrides: ${{ inputs.overrideDeps }} - - - name: Run tests - run: | - helm plugin install https://github.com/vbehar/helm3-unittest --version v1.0.16 - helm dep update "charts/${{ matrix.chart }}" - helm unittest -f "tests/**/*_test.yaml" "charts/${{ matrix.chart }}" - - # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 - unittest_success: - needs: - - unittest-chart - if: | - always() - name: Unittest successful - runs-on: ubuntu-22.04 - steps: - - name: Check unittest matrix status - if: ${{ (inputs.chartsToTest != '[]' && inputs.chartsToTest != '') && needs.unittest-chart.result != 'success' }} - run: exit 1 diff --git a/.vscode/settings.json b/.vscode/settings.json index c4e1fe4..fd4d874 100755 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,15 @@ "files.associations": { "*.json5": "jsonc" }, + "json.schemas": [ + { + "fileMatch": [ + "./github/renovate.json", + "./gitlab/renovate.json5" + ], + "url": "https://docs.renovatebot.com/renovate-schema.json" + } + ], "yaml.schemas": { "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json": [ From 51341cc0d4e4b0bc8cdaa9db0aef380714d0a074 Mon Sep 17 00:00:00 2001 From: "bloopy-boi[bot]" <98279278+bloopy-boi[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 23:32:44 +0000 Subject: [PATCH 05/11] chore(docker-image): update docker:dind docker digest to 0cbb848 --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19d35d3..7d26acb 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -50,7 +50,7 @@ docker_build: image: docker:latest@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 stage: build services: - - docker:dind@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 + - docker:dind@sha256:0cbb848730faec7cb371842dcf54fc061feebac06e56306b458c55bc9f9fd7e6 before_script: - !reference [.docker, before_script] script: @@ -81,7 +81,7 @@ docker_build: push_latest: image: docker:latest@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 services: - - docker:dind@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 + - docker:dind@sha256:0cbb848730faec7cb371842dcf54fc061feebac06e56306b458c55bc9f9fd7e6 variables: # Disable fresh pull of source GIT_STRATEGY: none @@ -100,7 +100,7 @@ push_latest: push_tag: image: docker:latest@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 services: - - docker:dind@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 + - docker:dind@sha256:0cbb848730faec7cb371842dcf54fc061feebac06e56306b458c55bc9f9fd7e6 variables: GIT_STRATEGY: none stage: push From ab5869c4210441f6830127098a40f366ec237c13 Mon Sep 17 00:00:00 2001 From: "bloopy-boi[bot]" <98279278+bloopy-boi[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 23:32:53 +0000 Subject: [PATCH 06/11] chore(docker-image): update docker:latest docker digest to 0cbb848 --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19d35d3..68d9f20 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ stages: docker_build: # Use the official docker image. - image: docker:latest@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 + image: docker:latest@sha256:0cbb848730faec7cb371842dcf54fc061feebac06e56306b458c55bc9f9fd7e6 stage: build services: - docker:dind@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 @@ -79,7 +79,7 @@ docker_build: # Tags only the $CI_DEFAULT_BRANCH as latest push_latest: - image: docker:latest@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 + image: docker:latest@sha256:0cbb848730faec7cb371842dcf54fc061feebac06e56306b458c55bc9f9fd7e6 services: - docker:dind@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 variables: @@ -98,7 +98,7 @@ push_latest: - docker push $CI_REGISTRY_IMAGE:latest push_tag: - image: docker:latest@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 + image: docker:latest@sha256:0cbb848730faec7cb371842dcf54fc061feebac06e56306b458c55bc9f9fd7e6 services: - docker:dind@sha256:0b0e8cab617d83dd041d950827dc67e18db5a0c3786d660bab002120b09a6d91 variables: From 05888773d78a74b8d313e10d5cf0c30c6396c95c Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Thu, 14 Mar 2024 19:31:04 -0400 Subject: [PATCH 07/11] don't run publish unecessarily --- .github/workflows/publish-snapshot.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/publish-snapshot.yaml b/.github/workflows/publish-snapshot.yaml index 058b505..dd9b813 100755 --- a/.github/workflows/publish-snapshot.yaml +++ b/.github/workflows/publish-snapshot.yaml @@ -5,6 +5,14 @@ push: branches: - dev + paths: + - 'go.mod' + - 'go.sum' + - '**.go' + - 'ent/**' + - '**.proto' + - 'Dockerfile' + - '.github/workflows/publish-snapshot.yaml' jobs: From 37abee5e443e9fd31872907e8092b953dba91980 Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Thu, 14 Mar 2024 19:31:26 -0400 Subject: [PATCH 08/11] comma --- .github/renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 25eb1b3..c285b3f 100755 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -21,5 +21,5 @@ "suppressNotifications": ["prIgnoreNotification"], "commitBodyTable": true, "rebaseWhen": "conflicted", - "postUpdateOptions": ["gomodTidy"], + "postUpdateOptions": ["gomodTidy"] } From 3f6d7dd6a065e722a9061e43bba39bbee3d2d14b Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Thu, 14 Mar 2024 19:38:21 -0400 Subject: [PATCH 09/11] add broken link checker --- .../workflows/schedule-broken-link-check.yaml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 .github/workflows/schedule-broken-link-check.yaml diff --git a/.github/workflows/schedule-broken-link-check.yaml b/.github/workflows/schedule-broken-link-check.yaml new file mode 100755 index 0000000..5a0f6b0 --- /dev/null +++ b/.github/workflows/schedule-broken-link-check.yaml @@ -0,0 +1,54 @@ +--- + name: Broken Link Check + + on: # yamllint disable-line rule:truthy + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + + jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - name: Generate Token + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + id: generate-token + with: + app_id: "${{ secrets.APP_ID }}" + private_key: "${{ secrets.APP_PRIVATE_KEY }}" + + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + token: "${{ steps.generate-token.outputs.token }}" + + - name: Scan for broken links + uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # v1.9.3 + id: lychee + env: + GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}" + with: + args: > + --verbose + --no-progress + --exclude-mail + './**/*.md' + + - name: Find Link Checker Issue + id: broken-link-check-issue + uses: micalevisk/last-issue-action@0d40124cc99ac8601c2516007f0c98ef3d27537b # v2.3.0 + with: + state: open + labels: | + broken-links + + - name: Update Issue + uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0 + with: + title: Broken links detected 🔗 + issue-number: "${{ steps.broken-link-check-issue.outputs.issue-number }}" + content-filepath: ./lychee/out.md + token: "${{ steps.generate-token.outputs.token }}" + labels: | + broken-links From 7f92c0a90cea94d2b8afbe1c66e6e24405c739a9 Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Thu, 14 Mar 2024 19:46:05 -0400 Subject: [PATCH 10/11] add annotations for golangci-lint --- .github/actions/lint/action.yaml | 4 ++-- .github/workflows/on-pr.yaml | 7 +++++++ .github/workflows/publish-snapshot.yaml | 7 +++++++ .github/workflows/versioned-release.yaml | 7 +++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/actions/lint/action.yaml b/.github/actions/lint/action.yaml index d4833fb..d34e6ca 100755 --- a/.github/actions/lint/action.yaml +++ b/.github/actions/lint/action.yaml @@ -1,6 +1,6 @@ --- -name: Tests -description: Runs Go tests +name: Lint +description: Runs golangci-lint on the project runs: using: composite diff --git a/.github/workflows/on-pr.yaml b/.github/workflows/on-pr.yaml index 19b117f..4dee49e 100755 --- a/.github/workflows/on-pr.yaml +++ b/.github/workflows/on-pr.yaml @@ -23,6 +23,13 @@ jobs: # uses: ent/contrib/ci@master lint: + permissions: + # Required: allow read access to the content for analysis. + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # Optional: Allow write access to checks to allow the action to annotate code in the PR. + checks: write runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/publish-snapshot.yaml b/.github/workflows/publish-snapshot.yaml index dd9b813..be86562 100755 --- a/.github/workflows/publish-snapshot.yaml +++ b/.github/workflows/publish-snapshot.yaml @@ -38,6 +38,13 @@ uses: ./.github/actions/tests lint: + permissions: + # Required: allow read access to the content for analysis. + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # Optional: Allow write access to checks to allow the action to annotate code in the PR. + checks: write runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/versioned-release.yaml b/.github/workflows/versioned-release.yaml index a84e608..67e7483 100755 --- a/.github/workflows/versioned-release.yaml +++ b/.github/workflows/versioned-release.yaml @@ -30,6 +30,13 @@ jobs: uses: ./.github/actions/tests lint: + permissions: + # Required: allow read access to the content for analysis. + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # Optional: Allow write access to checks to allow the action to annotate code in the PR. + checks: write runs-on: ubuntu-latest steps: - name: Checkout From c5c74a31f291a028c1f361c8a4ebcd669037391d Mon Sep 17 00:00:00 2001 From: Zee Aslam Date: Thu, 14 Mar 2024 19:46:21 -0400 Subject: [PATCH 11/11] add .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100755 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100755 index 0000000..4146c85 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.go eol=lf