From 47fc0a185b94fc5ee16f7676afe6d996b4f97c1e Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 16:31:24 +0300 Subject: [PATCH 01/12] feat: remove unnecessary actions --- .github/workflows/test-artifactory-login.yaml | 21 ---- .../workflows/test-build-and-push-docker.yaml | 36 ------ .github/workflows/test-eslint.yml | 18 --- .github/workflows/test-openapi-lint.yaml | 18 --- README.md | 10 -- actions/artifactory-login/CHANGELOG.md | 17 --- actions/artifactory-login/README.md | 25 ----- actions/artifactory-login/action.yaml | 22 ---- actions/build-and-push-helm/README.md | 4 +- actions/build-and-push-helm/action.yaml | 9 +- actions/build-docker/CHANGELOG.md | 36 ------ actions/build-docker/README.md | 48 -------- actions/build-docker/action.yaml | 50 --------- actions/eslint/CHANGELOG.md | 24 ---- actions/eslint/README.md | 22 ---- actions/eslint/action.yaml | 30 ----- actions/helm-lint/action.yaml | 7 +- actions/init-npm/action.yaml | 2 +- actions/openapi-lint/CHANGELOG.md | 17 --- actions/openapi-lint/README.md | 27 ----- actions/openapi-lint/action.yaml | 40 ------- actions/push-docker/CHANGELOG.md | 29 ----- actions/push-docker/README.md | 52 --------- actions/push-docker/action.yaml | 16 --- test/.redocly.yaml | 36 ------ test/dockerfile | 6 - test/eslint.config.mjs | 5 - test/openapi3.yaml | 106 ------------------ 28 files changed, 7 insertions(+), 726 deletions(-) delete mode 100644 .github/workflows/test-artifactory-login.yaml delete mode 100644 .github/workflows/test-build-and-push-docker.yaml delete mode 100644 .github/workflows/test-eslint.yml delete mode 100644 .github/workflows/test-openapi-lint.yaml delete mode 100644 actions/artifactory-login/CHANGELOG.md delete mode 100644 actions/artifactory-login/README.md delete mode 100644 actions/artifactory-login/action.yaml delete mode 100644 actions/build-docker/CHANGELOG.md delete mode 100644 actions/build-docker/README.md delete mode 100644 actions/build-docker/action.yaml delete mode 100644 actions/eslint/CHANGELOG.md delete mode 100644 actions/eslint/README.md delete mode 100644 actions/eslint/action.yaml delete mode 100644 actions/openapi-lint/CHANGELOG.md delete mode 100644 actions/openapi-lint/README.md delete mode 100644 actions/openapi-lint/action.yaml delete mode 100644 actions/push-docker/CHANGELOG.md delete mode 100644 actions/push-docker/README.md delete mode 100644 actions/push-docker/action.yaml delete mode 100644 test/.redocly.yaml delete mode 100644 test/dockerfile delete mode 100644 test/eslint.config.mjs delete mode 100644 test/openapi3.yaml diff --git a/.github/workflows/test-artifactory-login.yaml b/.github/workflows/test-artifactory-login.yaml deleted file mode 100644 index 977c6c51..00000000 --- a/.github/workflows/test-artifactory-login.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test artifactory-login action - -on: - pull_request: - paths: - - "actions/artifactory-login/**" - -jobs: - test-artifactory-login: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Test Login to Artifactory Action - id: test_artifactory_login - uses: ./actions/artifactory-login - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} diff --git a/.github/workflows/test-build-and-push-docker.yaml b/.github/workflows/test-build-and-push-docker.yaml deleted file mode 100644 index b6eb62cd..00000000 --- a/.github/workflows/test-build-and-push-docker.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Test Build and Push Docker Image - -on: - pull_request: - paths: - - "actions/build-docker/**" - - "actions/push-docker/**" - -jobs: - test-build-and-push: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Test Login to Artifactory Action - uses: ./actions/artifactory-login - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} - - - name: Test Build Docker Image - id: build_docker_image - uses: ./actions/build-docker - with: - context: ./test - domain: infra - registry: ${{ secrets.ACR_URL }} - tag: v1.0.0 - - - name: Test Push Docker Image - uses: ./actions/push-docker - with: - image_name: ${{ steps.build_docker_image.outputs.docker_image_full_name }} - image_tag: ${{ steps.build_docker_image.outputs.docker_image_tag }} diff --git a/.github/workflows/test-eslint.yml b/.github/workflows/test-eslint.yml deleted file mode 100644 index e520887d..00000000 --- a/.github/workflows/test-eslint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Test ESLint repository - -on: - pull_request: - paths: - - "actions/eslint/**" - -jobs: - test-eslint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: eslint - uses: ./actions/eslint - with: - path: ./test diff --git a/.github/workflows/test-openapi-lint.yaml b/.github/workflows/test-openapi-lint.yaml deleted file mode 100644 index 142628af..00000000 --- a/.github/workflows/test-openapi-lint.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Test OpenApi-lint - -on: - pull_request: - paths: - - "actions/opanapi-lint/**" - -jobs: - test-openapi-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: openapi-lint - uses: ./actions/openapi-lint - with: - path: ./test diff --git a/README.md b/README.md index 26dc4c0e..98b2f43c 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,9 @@ This repository contains GitHub Actions used across the MapColonies organization ``` . ├── actions/ # Reusable composite actions -│ ├── artifactory-login/ -│ ├── build-docker/ │ ├── build-and-push-helm/ │ ├── helm-lint/ │ ├── init-npm/ -│ ├── eslint/ -│ ├── openapi-lint/ -│ ├── push-docker/ │ └── update-artifacts-file/ ├── test/ # Assets for testing the actions ├── .github/workflows/ # Utility and Test workflows for each action @@ -45,13 +40,8 @@ Each action has a dedicated folder with: | Action | Description | |--------|-------------| -| `artifactory-login` | Logs in to Azure Container Registry | -| `build-docker` | Builds Docker images | -| `push-docker` | Pushes Docker images | | `build-and-push-helm` | Packages and publishes Helm charts | | `helm-lint` | Lints and tests Helm charts | -| `eslint` | Runs ESLint to check JavaScript/TypeScript code | -| `openapi-lint` | Validates OpenAPI specs using Redocly CLI | | `init-npm` | Initializes the repo with npm | | `update-artifacts-file` | Updates `artifacts.json` metadata | diff --git a/actions/artifactory-login/CHANGELOG.md b/actions/artifactory-login/CHANGELOG.md deleted file mode 100644 index 28e98a5e..00000000 --- a/actions/artifactory-login/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# Changelog - -## 1.0.0 (2025-04-22) - - -### ⚠ BREAKING CHANGES - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) - -### 🐛 Bug Fixes - -* release please cleanup ([#52](https://github.com/MapColonies/shared-workflows/issues/52)) ([e0f1058](https://github.com/MapColonies/shared-workflows/commit/e0f1058fb4bee4f89835709972e8ad6c8a3382f6)) - - -### ♻️ Code Refactoring - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) ([0a98534](https://github.com/MapColonies/shared-workflows/commit/0a9853421116d3bcc4cae4681977857cbc518e51)) diff --git a/actions/artifactory-login/README.md b/actions/artifactory-login/README.md deleted file mode 100644 index eea379e3..00000000 --- a/actions/artifactory-login/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# Artifactory Login Action - -This GitHub Action logs into MapColonies Artifactory (Azure Container Registry) to enable -authenticated operations like pulling or pushing images. - -## 🛠 Inputs - -| Name | Description | Required | -|-----------|------------------------------------------|----------| -| `registry` | The Artifactory registry URL | ✅ Yes | -| `username` | Username for the registry | ✅ Yes | -| `password` | Password or token for the registry | ✅ Yes | - -## 🚀 Usage - - -```yaml -- name: Artifactory Login - uses: MapColonies/shared-workflows/actions/artifactory-login@artifactory-login-v1.0.0 - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} -``` - diff --git a/actions/artifactory-login/action.yaml b/actions/artifactory-login/action.yaml deleted file mode 100644 index c6a15b6a..00000000 --- a/actions/artifactory-login/action.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: "Artifactory Login" -description: "Logs into the Artifactory registry." -inputs: - registry: - description: Azure Registry to authenticate against. - required: true - username: - description: Azure Registry username. - required: true - password: - description: Azure Registry password. - required: true - -runs: - using: composite - steps: - - name: Login to registry - uses: azure/docker-login@15c4aadf093404726ab2ff205b2cdd33fa6d054c # v2 - with: - login-server: ${{ inputs.registry }} - username: ${{ inputs.username }} - password: ${{ inputs.password }} diff --git a/actions/build-and-push-helm/README.md b/actions/build-and-push-helm/README.md index 2b5e9020..e2901855 100644 --- a/actions/build-and-push-helm/README.md +++ b/actions/build-and-push-helm/README.md @@ -21,7 +21,6 @@ This GitHub Action packages a Helm chart and pushes it to a Azure Container Regi ## 🚀 Usage - ```yaml - name: Artifactory Login uses: MapColonies/shared-workflows/actions/artifactory-login@9a05fd7a01e18746d69cc210b7e6defbd1cc79fc # v1.0.1 @@ -33,9 +32,8 @@ This GitHub Action packages a Helm chart and pushes it to a Azure Container Regi - name: Build and Push Helm Chart uses: MapColonies/shared-workflows/actions/build-and-push-helm@build-and-push-helm-v1.0.1 with: - context: ./infra/monitoring + context: ./PATH/TO/HELM/CHART domain: infra registry: ${{ secrets.ACR_URL }} ``` - diff --git a/actions/build-and-push-helm/action.yaml b/actions/build-and-push-helm/action.yaml index 078fe7c3..801e64c0 100644 --- a/actions/build-and-push-helm/action.yaml +++ b/actions/build-and-push-helm/action.yaml @@ -22,7 +22,7 @@ outputs: runs: using: "composite" steps: - - name: Checkout helm chart repository + - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Helm @@ -31,7 +31,7 @@ runs: version: "v3.12.0" - name: Get the chart's name - id: set_chart_name + id: chart_name run: | CHART=$(grep '^name:' Chart.yaml | awk '{print $2}') echo "chart=$CHART" >> $GITHUB_OUTPUT @@ -39,12 +39,11 @@ runs: shell: bash - name: Get chart's version - id: set_chart_version + id: chart_version run: | VER=$(grep '^version:' Chart.yaml | awk '{print $2}') echo "ver=$VER" >> $GITHUB_OUTPUT working-directory: ${{ inputs.context }} - shell: bash - name: Package chart into tgz file run: | @@ -54,6 +53,6 @@ runs: - name: Publish chart to ACR run: | - helm push "${{ steps.set_chart_name.outputs.chart }}-${{ steps.set_chart_version.outputs.ver }}.tgz" oci://${{ inputs.registry }}/helm/${{ inputs.domain }} + helm push "${{ steps.chart_name.outputs.chart }}-${{ steps.chart_version.outputs.ver }}.tgz" oci://${{ inputs.registry }}/helm/${{ inputs.domain }} working-directory: ${{ inputs.context }} shell: bash diff --git a/actions/build-docker/CHANGELOG.md b/actions/build-docker/CHANGELOG.md deleted file mode 100644 index e5c9e82f..00000000 --- a/actions/build-docker/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -# Changelog - -## [1.1.0](https://github.com/MapColonies/shared-workflows/compare/build-docker-v1.0.1...build-docker-v1.1.0) (2025-07-09) - - -### 🎉 Features - -* **build-docker:** add image full name as output ([#83](https://github.com/MapColonies/shared-workflows/issues/83)) ([4360537](https://github.com/MapColonies/shared-workflows/commit/4360537dbbd36c65a1decfd54076d1cfed2b4128)) - -## [1.0.1](https://github.com/MapColonies/shared-workflows/compare/build-docker-v1.0.0...build-docker-v1.0.1) (2025-07-08) - - -### 🐛 Bug Fixes - -* **docker-build-and-push:** add output to build image ([#80](https://github.com/MapColonies/shared-workflows/issues/80)) ([c97f7d2](https://github.com/MapColonies/shared-workflows/commit/c97f7d2cdbc642bef3169edda679809bc1bf0af5)) - - -### 📝 Documentation - -* change tags to sha ([#61](https://github.com/MapColonies/shared-workflows/issues/61)) ([1fc958d](https://github.com/MapColonies/shared-workflows/commit/1fc958d115218f9a928c489b085a806fd1fd6330)) - -## 1.0.0 (2025-04-22) - - -### ⚠ BREAKING CHANGES - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) - -### 🐛 Bug Fixes - -* release please cleanup ([#52](https://github.com/MapColonies/shared-workflows/issues/52)) ([e0f1058](https://github.com/MapColonies/shared-workflows/commit/e0f1058fb4bee4f89835709972e8ad6c8a3382f6)) - - -### ♻️ Code Refactoring - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) ([0a98534](https://github.com/MapColonies/shared-workflows/commit/0a9853421116d3bcc4cae4681977857cbc518e51)) diff --git a/actions/build-docker/README.md b/actions/build-docker/README.md deleted file mode 100644 index 16c4f0dd..00000000 --- a/actions/build-docker/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Build Docker Image Action - -This GitHub Action builds a Docker image from a specified context and outputs useful image information for downstream steps - -## 🛠 Inputs - -| Name | Description | Required | Default | -|--------------|-----------------------------------------------------------------------------|----------|------------------------| -| `context` | Path to the Docker build context | ❌ No | `.` | -| `repository` | Repository name for the Docker image (defaults to current GitHub repository)| ❌ No | `${{ github.repository }}` | -| `domain` | The image's domain (e.g. `3d`, `infra`). | ✅ Yes | — | -| `registry` | Azure Registry to authenticate against (e.g. ACR address). | ✅ Yes | — | -| `tag` | Tag for the Docker image | ❌ No | `${{ github.ref_name }}` | - -## 📤 Outputs - -| Name | Description | -|------------------------|--------------------------------------------------| -| `docker_image_name` | The name of the Docker image (repository name) | -| `docker_image_tag` | The version/tag of the Docker image | -| `docker_image_full_name` | The full name of the Docker image (including registry, domain, and repository) | - -## 🚀 Usage - - - -```yaml -- name: Artifactory Login - uses: MapColonies/shared-workflows/actions/artifactory-login@9a05fd7a01e18746d69cc210b7e6defbd1cc79fc # v1.1.0 - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} - -- name: Build Docker Image - uses: MapColonies/shared-workflows/actions/build-docker@build-docker-v1.1.0 - with: - domain: infra - registry: ${{ secrets.ACR_URL }} -``` - - ---- - -**Notes:** -- The `docker_image_name` output is just the repository name (e.g., `my-repo`). -- The `docker_image_full_name` output is the full image name including registry, domain, and repository (e.g., `myregistry.azurecr.io/infra/my-repo`). -- Use the outputs in downstream steps, such as for pushing the image. diff --git a/actions/build-docker/action.yaml b/actions/build-docker/action.yaml deleted file mode 100644 index da4d88b6..00000000 --- a/actions/build-docker/action.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: "Build Docker Image" -description: "Builds a Docker image" -inputs: - context: - description: "Path to the Docker build context" - required: false - default: "." - repository: - description: "Repository name for the Docker image (defaults to current GitHub repository)" - required: false - default: $(basename "${{ github.repository }}") - domain: - description: "The image's domain" - required: true - registry: - description: "Azure Registry to authenticate against" - required: true - tag: - description: "Tag for the Docker image" - required: false - default: ${{ github.ref_name }} -outputs: - docker_image_name: - description: "The name of the Docker image" - value: ${{ steps.set_image_name_and_tag.outputs.docker_image_name }} - docker_image_tag: - description: "The version of the Docker image" - value: ${{ steps.set_image_name_and_tag.outputs.docker_image_tag }} - docker_image_full_name: - description: "The version of the Docker image" - value: ${{ steps.set_image_name_and_tag.outputs.docker_image_full_name }} -runs: - using: "composite" - steps: - - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Setup Docker image name and tag - id: set_image_name_and_tag - run: | - DOCKER_IMAGE_TAG="${{ inputs.tag }}" - DOCKER_IMAGE_NAME="${{ inputs.registry }}/${{ inputs.domain }}/${{ inputs.repository }}" - echo "docker_image_name=${{ inputs.repository }}" >> $GITHUB_OUTPUT - echo "docker_image_full_name=$DOCKER_IMAGE_NAME" >> $GITHUB_OUTPUT - echo "docker_image_tag=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT - shell: bash - - - name: Build the docker image - run: docker build ${{ inputs.context }} -t ${{ steps.set_image_name_and_tag.outputs.docker_image_full_name }}:${{ steps.set_image_name_and_tag.outputs.docker_image_tag }} - shell: bash diff --git a/actions/eslint/CHANGELOG.md b/actions/eslint/CHANGELOG.md deleted file mode 100644 index d3f02c08..00000000 --- a/actions/eslint/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Changelog - -## [1.0.1](https://github.com/MapColonies/shared-workflows/compare/eslint-v1.0.0...eslint-v1.0.1) (2025-05-04) - - -### 🐛 Bug Fixes - -* compatibility of package.json and lock for npm ci ([#68](https://github.com/MapColonies/shared-workflows/issues/68)) ([9eee3d2](https://github.com/MapColonies/shared-workflows/commit/9eee3d24fed67883a1b7c27cfa5c73ecdb0bb646)) - -## 1.0.0 (2025-04-22) - - -### ⚠ BREAKING CHANGES - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) - -### 🐛 Bug Fixes - -* release please cleanup ([#52](https://github.com/MapColonies/shared-workflows/issues/52)) ([e0f1058](https://github.com/MapColonies/shared-workflows/commit/e0f1058fb4bee4f89835709972e8ad6c8a3382f6)) - - -### ♻️ Code Refactoring - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) ([0a98534](https://github.com/MapColonies/shared-workflows/commit/0a9853421116d3bcc4cae4681977857cbc518e51)) diff --git a/actions/eslint/README.md b/actions/eslint/README.md deleted file mode 100644 index 0d05f920..00000000 --- a/actions/eslint/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Run ESLint Action - -This GitHub Action installs dependencies and runs ESLint to lint your project codebase. - -## 🛠 Inputs - -| Name | Description | Default | Required | -|----------------|---------------------------------------|---------|----------| -| `node_version` | Node.js version to set up | `20` | false | -| `path` | Path to the directory containing your Node.js project| `.` | false | - -## 🚀 Usage - - - -```yaml -- name: Run ESLint - uses: MapColonies/shared-workflows/actions/eslint@eslint-v1.0.1 - with: - path: ./test -``` - diff --git a/actions/eslint/action.yaml b/actions/eslint/action.yaml deleted file mode 100644 index cbaa7e16..00000000 --- a/actions/eslint/action.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Run ESLint" -description: "Installs dependencies and runs ESLint" -inputs: - node_version: - description: "Node.js version" - default: "20" - required: false - path: - description: "Path to the Node.js dir " - default: "." - required: false - -runs: - using: "composite" - steps: - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Node.js - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 - with: - node-version: ${{ inputs['node_version'] }} - - - run: npm ci - shell: bash - working-directory: ${{ inputs.path }} - - - run: npm run lint - shell: bash - working-directory: ${{ inputs.path }} diff --git a/actions/helm-lint/action.yaml b/actions/helm-lint/action.yaml index 22dd493e..3bec6c9e 100644 --- a/actions/helm-lint/action.yaml +++ b/actions/helm-lint/action.yaml @@ -3,7 +3,7 @@ description: "An action to lint and test Helm charts using chart-testing and kin inputs: chartDirs: description: "Comma-separated list of root directories containing Helm charts." - required: true + required: false default: "." outputs: changed: @@ -12,11 +12,6 @@ outputs: runs: using: "composite" steps: - - name: Checkout helm chart repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - name: Set up Helm uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 with: diff --git a/actions/init-npm/action.yaml b/actions/init-npm/action.yaml index 309514e8..5df5fbf7 100644 --- a/actions/init-npm/action.yaml +++ b/actions/init-npm/action.yaml @@ -4,7 +4,7 @@ inputs: node-version: description: 'Node.js version' required: true - default: '20.x' + default: '22.x' path: description: "Path to the Node.js directory" default: "." diff --git a/actions/openapi-lint/CHANGELOG.md b/actions/openapi-lint/CHANGELOG.md deleted file mode 100644 index 28e98a5e..00000000 --- a/actions/openapi-lint/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# Changelog - -## 1.0.0 (2025-04-22) - - -### ⚠ BREAKING CHANGES - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) - -### 🐛 Bug Fixes - -* release please cleanup ([#52](https://github.com/MapColonies/shared-workflows/issues/52)) ([e0f1058](https://github.com/MapColonies/shared-workflows/commit/e0f1058fb4bee4f89835709972e8ad6c8a3382f6)) - - -### ♻️ Code Refactoring - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) ([0a98534](https://github.com/MapColonies/shared-workflows/commit/0a9853421116d3bcc4cae4681977857cbc518e51)) diff --git a/actions/openapi-lint/README.md b/actions/openapi-lint/README.md deleted file mode 100644 index a8d2e23c..00000000 --- a/actions/openapi-lint/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# OpenAPI Lint Action - -This GitHub Action installs Node.js dependencies, runs code linting, and validates an OpenAPI specification using Redocly CLI. - - -## 🛠 Inputs - -| Name | Description | Default | Required | -|----------------|---------------------------------------|---------|----------| -| `node_version` | Node.js version to set up | `20` | ❌ No | -| `path` | Path to the directory containing your Node.js project| `.` | ❌ No | -| `openapi-file` | Path to the OpenAPI file (e.g. ./openapi3.yaml) | `.` | ❌ No | - -## 🚀 Usage - - - -```yaml -- name: Run OpenAPI Lint - uses: MapColonies/shared-workflows/actions/openapi-lint@openapi-lint-v1.0.0 - with: - node_version: "20" - openapi-file: "./openapi3.yaml" - path: "." - -``` - diff --git a/actions/openapi-lint/action.yaml b/actions/openapi-lint/action.yaml deleted file mode 100644 index db517efc..00000000 --- a/actions/openapi-lint/action.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: "OpenAPI Lint" -description: "Installs dependencies, runs code linting, and validates OpenAPI spec using Redocly CLI" - -inputs: - node_version: - description: "Node.js version to use" - required: false - default: "20" - openapi_file: - description: "Path to the OpenAPI file (e.g. ./openapi.yaml)" - required: false - default: "./openapi3.yaml" - path: - description: "Path to the Node.js directory" - required: false - default: "." - -runs: - using: "composite" - steps: - - name: Checkout helm chart repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Set up Node.js - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 - with: - node-version: ${{ inputs['node_version'] }} - - - run: npm install - shell: bash - working-directory: ${{ inputs.path }} - - - run: npm ci - shell: bash - working-directory: ${{ inputs.path }} - - - name: OpenAPI Lint - run: npx @redocly/cli lint --format=github-actions ${{ inputs.openapi_file }} - shell: bash - working-directory: ${{ inputs.path }} diff --git a/actions/push-docker/CHANGELOG.md b/actions/push-docker/CHANGELOG.md deleted file mode 100644 index 946b7ec6..00000000 --- a/actions/push-docker/CHANGELOG.md +++ /dev/null @@ -1,29 +0,0 @@ -# Changelog - -## [1.0.1](https://github.com/MapColonies/shared-workflows/compare/push-docker-v1.0.0...push-docker-v1.0.1) (2025-07-08) - - -### 🐛 Bug Fixes - -* **docker-build-and-push:** add output to build image ([#80](https://github.com/MapColonies/shared-workflows/issues/80)) ([c97f7d2](https://github.com/MapColonies/shared-workflows/commit/c97f7d2cdbc642bef3169edda679809bc1bf0af5)) - - -### 📝 Documentation - -* change tags to sha ([#61](https://github.com/MapColonies/shared-workflows/issues/61)) ([1fc958d](https://github.com/MapColonies/shared-workflows/commit/1fc958d115218f9a928c489b085a806fd1fd6330)) - -## 1.0.0 (2025-04-22) - - -### ⚠ BREAKING CHANGES - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) - -### 🐛 Bug Fixes - -* release please cleanup ([#52](https://github.com/MapColonies/shared-workflows/issues/52)) ([e0f1058](https://github.com/MapColonies/shared-workflows/commit/e0f1058fb4bee4f89835709972e8ad6c8a3382f6)) - - -### ♻️ Code Refactoring - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) ([0a98534](https://github.com/MapColonies/shared-workflows/commit/0a9853421116d3bcc4cae4681977857cbc518e51)) diff --git a/actions/push-docker/README.md b/actions/push-docker/README.md deleted file mode 100644 index 7cf884a5..00000000 --- a/actions/push-docker/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Push Docker Image Action - -This GitHub Action pushes a pre-built Docker image to a container registry. - -It is intended to be used **after building an image** using another action like [`build-docker`](../build-docker/). -This action assumes the image is already tagged and available in the local Docker cache. - ---- - -## 🛠 Inputs - -| Name | Description | Required | Default | -|--------------|---------------------------------------------------------------------------------------------------|----------|----------| -| `image_name` | The name of the Docker image to push, including the registry and repository (e.g., `myregistry.azurecr.io/myrepo/myimage`) | ✅ Yes | | -| `image_tag` | Tag of the Docker image to push | ❌ No | `latest` | - ---- - -## 🚀 Usage Example - - - -```yaml -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Login to Registry - uses: MapColonies/shared-workflows/actions/artifactory-login@9a05fd7a01e18746d69cc210b7e6defbd1cc79fc # v1.0.1 - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} - - - name: Build Docker Image - id: build - uses: MapColonies/shared-workflows/actions/build-docker@e7220d24b1c7ee5c8eaac7e50edc60239e829eb4 # v1.0.1 - with: - context: ./test - domain: infra - registry: ${{ secrets.ACR_URL }} - - - name: Push Docker Image - uses: MapColonies/shared-workflows/actions/push-docker@push-docker-v1.0.1 - with: - image_name: ${{ steps.build.outputs.docker_image_name }} - image_tag: ${{ steps.build.outputs.docker_image_tag }} -``` - diff --git a/actions/push-docker/action.yaml b/actions/push-docker/action.yaml deleted file mode 100644 index fcd8c700..00000000 --- a/actions/push-docker/action.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Push Docker Image" -description: "Pushes a previously built Docker image." -inputs: - image_name: - description: "Name of the Docker image to push, including the registry and repository (e.g., 'myregistry.azurecr.io/myrepo/myimage')" - required: true - image_tag: - description: "Tag of the Docker image to push" - required: false - default: "latest" -runs: - using: "composite" - steps: - - name: Push docker image - run: docker push ${{ inputs.image_name }}:${{ inputs.image_tag }} - shell: bash diff --git a/test/.redocly.yaml b/test/.redocly.yaml deleted file mode 100644 index dd8cac61..00000000 --- a/test/.redocly.yaml +++ /dev/null @@ -1,36 +0,0 @@ -plugins: - [] - # This section is where you can import local plugins. - # We don't support community plugins. - # You don't need to import our built-in plugins and rules. - # Omit this section if you don't have custom plugins. - # - './local-plugin.js' - -extends: - # This section is where you choose the base configurations. - # You may override specific settings in the subsequent sections. - - recommended # This is the default (and built in) configuration. If it is too strict, try `minimal`. - -resolve: - {} - # Use this when you have external links in your definition that are not publicly accessible. - # Not required for Redocly API registry links. - # We recommend using environment variables for when possible. - -preprocessors: - {} - # Preprocessors are rarely indicated -- avoid if possible. - # This section can be omitted. - -rules: - boolean-parameter-prefixes: - severity: error - prefixes: ["should", "is", "has"] - no-unused-components: - severity: error - no-empty-servers: off - -decorators: - {} - # Decorators modify the the definition after validation is complete, only in the bundling process. - # This section can be omitted if you don't use decorators. diff --git a/test/dockerfile b/test/dockerfile deleted file mode 100644 index cb7cb373..00000000 --- a/test/dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -# Use the official Alpine Linux image as the base image -FROM alpine:latest - -WORKDIR /app - -RUN echo "echo 'Hello, world!'" > hello.sh diff --git a/test/eslint.config.mjs b/test/eslint.config.mjs deleted file mode 100644 index f1cdbe23..00000000 --- a/test/eslint.config.mjs +++ /dev/null @@ -1,5 +0,0 @@ -import tsBaseConfig from "@map-colonies/eslint-config/ts-base"; -// import jestConfig from "@map-colonies/eslint-config/jest"; -import { config } from "@map-colonies/eslint-config/helpers"; - -export default config({}, tsBaseConfig); diff --git a/test/openapi3.yaml b/test/openapi3.yaml deleted file mode 100644 index 6194ceb2..00000000 --- a/test/openapi3.yaml +++ /dev/null @@ -1,106 +0,0 @@ -openapi: 3.0.1 -info: - title: service-name - description: basic template for map colonies service - version: 1.0.0 - license: - name: MIT - url: https://opensource.org/licenses/MIT -paths: - /anotherResource: - get: - operationId: getAnotherResource - tags: - - anotherResource - summary: gets the resource - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/anotherResource" - 400: - description: Bad Request - content: - application/json: - schema: - $ref: "#/components/schemas/error" - /resourceName: - get: - operationId: getResourceName - tags: - - resourceName - summary: gets the resource - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: "#/components/schemas/resource" - 400: - description: Bad Request - content: - application/json: - schema: - $ref: "#/components/schemas/error" - post: - operationId: createResource - tags: - - resourceName - summary: creates a new record of type resource - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/resource" - responses: - 201: - description: created - content: - application/json: - schema: - $ref: "#/components/schemas/resource" - 400: - description: Bad Request - content: - application/json: - schema: - $ref: "#/components/schemas/error" -security: - - {} -components: - schemas: - error: - type: object - required: - - message - properties: - message: - type: string - resource: - type: object - required: - - id - - name - - description - properties: - id: - type: number - format: int64 - name: - type: string - description: - type: string - anotherResource: - type: object - required: - - kind - - isAlive - properties: - kind: - type: string - isAlive: - type: boolean From d40ae1c57f59a8dfb0260faba86023e9df2740cc Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 16:37:53 +0300 Subject: [PATCH 02/12] fix: default values --- actions/helm-lint/README.md | 4 ++-- actions/helm-lint/action.yaml | 8 ++++---- actions/init-npm/README.md | 4 ++-- actions/init-npm/action.yaml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actions/helm-lint/README.md b/actions/helm-lint/README.md index cd2f19be..c0a1dae7 100644 --- a/actions/helm-lint/README.md +++ b/actions/helm-lint/README.md @@ -9,7 +9,7 @@ It detects which charts have changed and only tests those. | Name | Description | Required | |--------------|--------------------------------------------------------------|----------| -| `chartDirs` | Comma-separated list of root directories with Helm charts. | ✅ Yes | +| `chartPaths` | Comma-separated list of root directories with Helm charts. | No | ## 📤 Outputs @@ -25,6 +25,6 @@ It detects which charts have changed and only tests those. - name: Lint and Test Charts uses: MapColonies/shared-workflows/actions/helm-lint@helm-lint-v1.0.0 with: - chartDirs: infra/monitoring,infra/sftpgo + chartPaths: infra/monitoring,infra/sftpgo ``` diff --git a/actions/helm-lint/action.yaml b/actions/helm-lint/action.yaml index 3bec6c9e..f17dbbcf 100644 --- a/actions/helm-lint/action.yaml +++ b/actions/helm-lint/action.yaml @@ -1,7 +1,7 @@ name: "Lint and Test Helm Charts" description: "An action to lint and test Helm charts using chart-testing and kind." inputs: - chartDirs: + chartPaths: description: "Comma-separated list of root directories containing Helm charts." required: false default: "." @@ -29,7 +29,7 @@ runs: - name: Run chart-testing (list-changed) id: list_changed run: | - changed=$(ct list-changed --chart-dirs "${{ inputs.chartDirs }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}") + changed=$(ct list-changed --chart-dirs "${{ inputs.chartPaths }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}") if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" fi @@ -37,7 +37,7 @@ runs: - name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' - run: ct lint --chart-dirs "${{ inputs.chartDirs }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}" + run: ct lint --chart-dirs "${{ inputs.chartPaths }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}" shell: bash - name: Create kind cluster @@ -46,5 +46,5 @@ runs: - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' - run: ct install --chart-dirs "${{ inputs.chartDirs }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}" + run: ct install --chart-dirs "${{ inputs.chartPaths }}" --target-branch "${{ github.base_ref || github.event.repository.default_branch }}" shell: bash diff --git a/actions/init-npm/README.md b/actions/init-npm/README.md index caa2ae89..9bd52077 100644 --- a/actions/init-npm/README.md +++ b/actions/init-npm/README.md @@ -6,7 +6,7 @@ This GitHub Action sets up Node.js, installs dependencies using npm, and builds | Name | Description | Default | Required | |----------------|---------------------------------------|---------|----------| -| `node_version` | Node.js version to set up ([supported versions](https://github.com/actions/setup-node#supported-version-syntax)) | `20.x` | false | +| `node_version` | Node.js version to set up ([supported versions](https://github.com/actions/setup-node#supported-version-syntax)) | `22.x` | false | | `path` | Path to the directory containing your Node.js project | `.` | false | ## 🚀 Usage @@ -16,6 +16,6 @@ This GitHub Action sets up Node.js, installs dependencies using npm, and builds - name: Initialize NPM Project uses: MapColonies/shared-workflows/actions/init-npm@init-npm-v1.0.0 with: - node-version: '20.x' + node-version: '22.x' ``` diff --git a/actions/init-npm/action.yaml b/actions/init-npm/action.yaml index 5df5fbf7..79ab1c1e 100644 --- a/actions/init-npm/action.yaml +++ b/actions/init-npm/action.yaml @@ -3,7 +3,7 @@ description: 'Initialize the repo with npm and install all the dependencies' inputs: node-version: description: 'Node.js version' - required: true + required: false default: '22.x' path: description: "Path to the Node.js directory" From d4fa4b2774a1b38a96321a991a2b3ba7c320f380 Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 17:08:59 +0300 Subject: [PATCH 03/12] fix: helm action --- actions/helm-lint/action.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actions/helm-lint/action.yaml b/actions/helm-lint/action.yaml index f17dbbcf..bad515c7 100644 --- a/actions/helm-lint/action.yaml +++ b/actions/helm-lint/action.yaml @@ -12,6 +12,11 @@ outputs: runs: using: "composite" steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + - name: Set up Helm uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 with: From 12c4c7ac70eda2da122d888dd7cdeb0af863e382 Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 18:10:59 +0300 Subject: [PATCH 04/12] build: use major versions --- actions/helm-lint/action.yaml | 8 ++++---- actions/init-npm/action.yaml | 2 +- actions/update-artifacts-file/action.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actions/helm-lint/action.yaml b/actions/helm-lint/action.yaml index bad515c7..91c5a807 100644 --- a/actions/helm-lint/action.yaml +++ b/actions/helm-lint/action.yaml @@ -13,23 +13,23 @@ runs: using: "composite" steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 + uses: azure/setup-helm@v4 with: version: v3.16.3 - name: Set up Python - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5 + uses: actions/setup-python@v6 with: python-version: '3.x' check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1 + uses: helm/chart-testing-action@v2 - name: Run chart-testing (list-changed) id: list_changed diff --git a/actions/init-npm/action.yaml b/actions/init-npm/action.yaml index 79ab1c1e..0be5fa99 100644 --- a/actions/init-npm/action.yaml +++ b/actions/init-npm/action.yaml @@ -13,7 +13,7 @@ runs: using: composite steps: - name: Set up Node.js - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4 + uses: actions/setup-node@v5 with: node-version: ${{ inputs.node-version }} cache: 'npm' diff --git a/actions/update-artifacts-file/action.yaml b/actions/update-artifacts-file/action.yaml index 064425c2..9936d85a 100644 --- a/actions/update-artifacts-file/action.yaml +++ b/actions/update-artifacts-file/action.yaml @@ -36,7 +36,7 @@ runs: using: "composite" steps: - name: Checkout helm chart repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v5 with: repository: ${{ inputs.target_repo }} token: ${{ inputs.github_token }} From a9eb1a77af921f21700b74b2f23b4722fcd042c9 Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 18:14:49 +0300 Subject: [PATCH 05/12] fix: use proper action --- .github/workflows/test-build-and-push-helm.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-build-and-push-helm.yaml b/.github/workflows/test-build-and-push-helm.yaml index 8a57b4eb..aa44d8cc 100644 --- a/.github/workflows/test-build-and-push-helm.yaml +++ b/.github/workflows/test-build-and-push-helm.yaml @@ -12,9 +12,8 @@ jobs: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Test Login to Artifactory Action - id: test_artifactory_login - uses: ./actions/artifactory-login + - name: Login to Azure Container Registry + uses: docker/login-action@v3 with: registry: ${{ secrets.ACR_URL }} username: ${{ secrets.ACR_PUSH_USER }} From 8fafe7607e90be9d4737b0e8fe60d562f185e84a Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 18:20:26 +0300 Subject: [PATCH 06/12] build: use major versions --- .github/workflows/release-please.yaml | 4 ++-- .github/workflows/test-build-and-push-helm.yaml | 2 +- .github/workflows/test-helm-lint.yml | 2 +- .github/workflows/test-init-npm.yaml | 2 +- .github/workflows/test-update-artifacts-file.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index e24a01d5..42c3fba3 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -9,7 +9,7 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4.2.0 + - uses: googleapis/release-please-action@v4 id: release with: config-file: release-please-config.json @@ -28,7 +28,7 @@ jobs: # `/--sha`. - name: tag major and minor versions if: steps.release.outputs.releases_created == 'true' - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + uses: actions/github-script@v7 env: RELEASES: ${{ toJSON(steps.release.outputs) }} with: diff --git a/.github/workflows/test-build-and-push-helm.yaml b/.github/workflows/test-build-and-push-helm.yaml index aa44d8cc..f1e6137a 100644 --- a/.github/workflows/test-build-and-push-helm.yaml +++ b/.github/workflows/test-build-and-push-helm.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v5 - name: Login to Azure Container Registry uses: docker/login-action@v3 diff --git a/.github/workflows/test-helm-lint.yml b/.github/workflows/test-helm-lint.yml index ada31ff9..b455da55 100644 --- a/.github/workflows/test-helm-lint.yml +++ b/.github/workflows/test-helm-lint.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v5 - name: helm lint uses: ./actions/helm-lint diff --git a/.github/workflows/test-init-npm.yaml b/.github/workflows/test-init-npm.yaml index cf7fac22..76205541 100644 --- a/.github/workflows/test-init-npm.yaml +++ b/.github/workflows/test-init-npm.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v5 - name: Test init-npm action uses: ./actions/init-npm diff --git a/.github/workflows/test-update-artifacts-file.yml b/.github/workflows/test-update-artifacts-file.yml index c0aa9781..b4665d39 100644 --- a/.github/workflows/test-update-artifacts-file.yml +++ b/.github/workflows/test-update-artifacts-file.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@v5 - name: Update artifacts.json uses: ./actions/update-artifacts-file From f07d2ea6b5d9b29a223161c740378f99f7c43e21 Mon Sep 17 00:00:00 2001 From: netanelC Date: Sun, 21 Sep 2025 18:23:50 +0300 Subject: [PATCH 07/12] fix: action --- actions/build-and-push-helm/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actions/build-and-push-helm/action.yaml b/actions/build-and-push-helm/action.yaml index 801e64c0..21b2284c 100644 --- a/actions/build-and-push-helm/action.yaml +++ b/actions/build-and-push-helm/action.yaml @@ -1,5 +1,6 @@ name: "Build and Push Helm Chart" description: "Builds and publishes a Helm chart to the specified registry." + inputs: domain: description: "The chart's domain." @@ -44,6 +45,7 @@ runs: VER=$(grep '^version:' Chart.yaml | awk '{print $2}') echo "ver=$VER" >> $GITHUB_OUTPUT working-directory: ${{ inputs.context }} + shell: bash - name: Package chart into tgz file run: | From 0e068fb69e300de5e2ddeb254c1697f2a188ea12 Mon Sep 17 00:00:00 2001 From: netanelC Date: Thu, 25 Sep 2025 14:18:04 +0300 Subject: [PATCH 08/12] feat: remove helm pushing action --- actions/build-and-push-helm/CHANGELOG.md | 29 ------------ actions/build-and-push-helm/README.md | 39 --------------- actions/build-and-push-helm/action.yaml | 60 ------------------------ actions/helm-lint/action.yaml | 5 -- 4 files changed, 133 deletions(-) delete mode 100644 actions/build-and-push-helm/CHANGELOG.md delete mode 100644 actions/build-and-push-helm/README.md delete mode 100644 actions/build-and-push-helm/action.yaml diff --git a/actions/build-and-push-helm/CHANGELOG.md b/actions/build-and-push-helm/CHANGELOG.md deleted file mode 100644 index e470b824..00000000 --- a/actions/build-and-push-helm/CHANGELOG.md +++ /dev/null @@ -1,29 +0,0 @@ -# Changelog - -## [1.0.1](https://github.com/MapColonies/shared-workflows/compare/build-and-push-helm-v1.0.0...build-and-push-helm-v1.0.1) (2025-07-03) - - -### 🐛 Bug Fixes - -* **build-and-push-helm:** fix action ([#76](https://github.com/MapColonies/shared-workflows/issues/76)) ([574a862](https://github.com/MapColonies/shared-workflows/commit/574a862a7713bb43a5a4b7f0bc6f82586f5bdaf0)) - - -### 📝 Documentation - -* change tags to sha ([#61](https://github.com/MapColonies/shared-workflows/issues/61)) ([1fc958d](https://github.com/MapColonies/shared-workflows/commit/1fc958d115218f9a928c489b085a806fd1fd6330)) - -## 1.0.0 (2025-04-22) - - -### ⚠ BREAKING CHANGES - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) - -### 🐛 Bug Fixes - -* release please cleanup ([#52](https://github.com/MapColonies/shared-workflows/issues/52)) ([e0f1058](https://github.com/MapColonies/shared-workflows/commit/e0f1058fb4bee4f89835709972e8ad6c8a3382f6)) - - -### ♻️ Code Refactoring - -* **workflows:** break workflows into actions ([#41](https://github.com/MapColonies/shared-workflows/issues/41)) ([0a98534](https://github.com/MapColonies/shared-workflows/commit/0a9853421116d3bcc4cae4681977857cbc518e51)) diff --git a/actions/build-and-push-helm/README.md b/actions/build-and-push-helm/README.md deleted file mode 100644 index e2901855..00000000 --- a/actions/build-and-push-helm/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Build and Push Helm Chart Action - -This GitHub Action packages a Helm chart and pushes it to a Azure Container Registry. - -## 🛠 Inputs - -| Name | Description | Required | Default | -|--------------|-----------------------------------------------------------------------------------------------|----------|------------------------| -| `domain` | The chart's domain (e.g. `3d`, `infra`). | ✅ Yes | | -| `context` | Relative path to the Helm chart directory | ❌ No | `./helm` | -| `registry` | OCI registry URL where the chart will be pushed (e.g. ACR address) | ✅ Yes | | - - -## 📤 Outputs - -| Name | Description | -|---------|----------------------------------| -| `chart` | Name of the Helm chart | -| `ver` | Version of the Helm chart | - -## 🚀 Usage - - -```yaml -- name: Artifactory Login - uses: MapColonies/shared-workflows/actions/artifactory-login@9a05fd7a01e18746d69cc210b7e6defbd1cc79fc # v1.0.1 - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} - -- name: Build and Push Helm Chart - uses: MapColonies/shared-workflows/actions/build-and-push-helm@build-and-push-helm-v1.0.1 - with: - context: ./PATH/TO/HELM/CHART - domain: infra - registry: ${{ secrets.ACR_URL }} -``` - diff --git a/actions/build-and-push-helm/action.yaml b/actions/build-and-push-helm/action.yaml deleted file mode 100644 index 21b2284c..00000000 --- a/actions/build-and-push-helm/action.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: "Build and Push Helm Chart" -description: "Builds and publishes a Helm chart to the specified registry." - -inputs: - domain: - description: "The chart's domain." - required: true - context: - description: "Path to the helm directory." - required: false - default: "./helm" - registry: - description: "Azure Registry to authenticate against." - required: true -outputs: - chart: - description: "The name of the chart." - value: ${{ steps.set_chart_name.outputs.chart }} - ver: - description: "The version of the chart." - value: ${{ steps.set_chart_version.outputs.ver }} - -runs: - using: "composite" - steps: - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Setup Helm - uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 - with: - version: "v3.12.0" - - - name: Get the chart's name - id: chart_name - run: | - CHART=$(grep '^name:' Chart.yaml | awk '{print $2}') - echo "chart=$CHART" >> $GITHUB_OUTPUT - working-directory: ${{ inputs.context }} - shell: bash - - - name: Get chart's version - id: chart_version - run: | - VER=$(grep '^version:' Chart.yaml | awk '{print $2}') - echo "ver=$VER" >> $GITHUB_OUTPUT - working-directory: ${{ inputs.context }} - shell: bash - - - name: Package chart into tgz file - run: | - helm package . --dependency-update - working-directory: ${{ inputs.context }} - shell: bash - - - name: Publish chart to ACR - run: | - helm push "${{ steps.chart_name.outputs.chart }}-${{ steps.chart_version.outputs.ver }}.tgz" oci://${{ inputs.registry }}/helm/${{ inputs.domain }} - working-directory: ${{ inputs.context }} - shell: bash diff --git a/actions/helm-lint/action.yaml b/actions/helm-lint/action.yaml index 91c5a807..47160c67 100644 --- a/actions/helm-lint/action.yaml +++ b/actions/helm-lint/action.yaml @@ -12,11 +12,6 @@ outputs: runs: using: "composite" steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Set up Helm uses: azure/setup-helm@v4 with: From f71a1f11485c04f9c894aa80f684b8643cfd5a38 Mon Sep 17 00:00:00 2001 From: netanelC Date: Thu, 25 Sep 2025 18:04:27 +0300 Subject: [PATCH 09/12] ci: remove all references of deleted actions --- .../workflows/test-build-and-push-helm.yaml | 27 ----------------- .release-please-manifest.json | 6 ---- README.md | 2 -- release-please-config.json | 30 ------------------- 4 files changed, 65 deletions(-) delete mode 100644 .github/workflows/test-build-and-push-helm.yaml diff --git a/.github/workflows/test-build-and-push-helm.yaml b/.github/workflows/test-build-and-push-helm.yaml deleted file mode 100644 index f1e6137a..00000000 --- a/.github/workflows/test-build-and-push-helm.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test Build and Push Helm Chart - -on: - pull_request: - paths: - - "actions/build-and-push-helm/**" - -jobs: - test-build-and-push: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - - - name: Login to Azure Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ secrets.ACR_URL }} - username: ${{ secrets.ACR_PUSH_USER }} - password: ${{ secrets.ACR_PUSH_TOKEN }} - - - name: Test Build and push Helm Chart - uses: ./actions/build-and-push-helm - with: - context: ./test/helm - domain: infra - registry: ${{ secrets.ACR_URL }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9ca874c5..58768a54 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,12 +1,6 @@ { ".": "6.0.0", - "actions/build-and-push-helm": "1.0.1", "actions/helm-lint": "1.0.0", - "actions/eslint": "1.0.1", - "actions/push-docker": "1.0.1", - "actions/artifactory-login": "1.0.0", "actions/update-artifacts-file": "1.1.1", - "actions/build-docker": "1.1.0", - "actions/openapi-lint": "1.0.0", "actions/init-npm": "1.0.0" } diff --git a/README.md b/README.md index 98b2f43c..6bdc9914 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ This repository contains GitHub Actions used across the MapColonies organization ``` . ├── actions/ # Reusable composite actions -│ ├── build-and-push-helm/ │ ├── helm-lint/ │ ├── init-npm/ │ └── update-artifacts-file/ @@ -40,7 +39,6 @@ Each action has a dedicated folder with: | Action | Description | |--------|-------------| -| `build-and-push-helm` | Packages and publishes Helm charts | | `helm-lint` | Lints and tests Helm charts | | `init-npm` | Initializes the repo with npm | | `update-artifacts-file` | Updates `artifacts.json` metadata | diff --git a/release-please-config.json b/release-please-config.json index d176a8d8..64e155e3 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -54,41 +54,11 @@ "include-v-in-tag": true, "separate-pull-requests": true, "packages": { - "actions/artifactory-login": { - "release-type": "simple", - "package-name": "artifactory-login", - "extra-files": ["README.md"] - }, - "actions/build-docker": { - "release-type": "simple", - "package-name": "build-docker", - "extra-files": ["README.md"] - }, - "actions/push-docker": { - "release-type": "simple", - "package-name": "push-docker", - "extra-files": ["README.md"] - }, - "actions/build-and-push-helm": { - "release-type": "simple", - "package-name": "build-and-push-helm", - "extra-files": ["README.md"] - }, - "actions/eslint": { - "release-type": "simple", - "package-name": "eslint", - "extra-files": ["README.md"] - }, "actions/helm-lint": { "release-type": "simple", "package-name": "helm-lint", "extra-files": ["README.md"] }, - "actions/openapi-lint": { - "release-type": "simple", - "package-name": "openapi-lint", - "extra-files": ["README.md"] - }, "actions/update-artifacts-file": { "release-type": "simple", "package-name": "update-artifacts-file", From 429280d9c7da019fcc39673504eadb44072660fb Mon Sep 17 00:00:00 2001 From: netanelC Date: Thu, 25 Sep 2025 18:11:52 +0300 Subject: [PATCH 10/12] ci: fix test --- .github/workflows/test-helm-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-helm-lint.yml b/.github/workflows/test-helm-lint.yml index b455da55..6e2e764f 100644 --- a/.github/workflows/test-helm-lint.yml +++ b/.github/workflows/test-helm-lint.yml @@ -21,7 +21,7 @@ jobs: id: helm-lint with: repository: ${{ github.repository }} - chartDirs: "./test/helm" + chartPaths: "./test/helm" - name: Print on chart change if: steps.helm-lint.outputs.changed == 'true' From 15bb156982d7922d221ed10b704077adbbf85bd5 Mon Sep 17 00:00:00 2001 From: netanelC Date: Thu, 25 Sep 2025 18:12:33 +0300 Subject: [PATCH 11/12] ci: fix test --- .github/workflows/test-helm-lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-helm-lint.yml b/.github/workflows/test-helm-lint.yml index 6e2e764f..9a829789 100644 --- a/.github/workflows/test-helm-lint.yml +++ b/.github/workflows/test-helm-lint.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v5 + with: + fetch-depth: 0 - name: helm lint uses: ./actions/helm-lint From 1700807593baf1b4ea45548c2bee57549b56cc4f Mon Sep 17 00:00:00 2001 From: Netanel Cohen <34451523+netanelC@users.noreply.github.com> Date: Thu, 25 Sep 2025 19:07:17 +0300 Subject: [PATCH 12/12] fix: remove unnecessary checkout (#92) --- actions/update-artifacts-file/action.yaml | 4 ++-- actions/update-artifacts-file/commit_changes.sh | 4 +--- actions/update-artifacts-file/modify_artifacts.sh | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/actions/update-artifacts-file/action.yaml b/actions/update-artifacts-file/action.yaml index 9936d85a..a90b7a83 100644 --- a/actions/update-artifacts-file/action.yaml +++ b/actions/update-artifacts-file/action.yaml @@ -52,7 +52,7 @@ runs: ARTIFACT_TAG: ${{ inputs.artifact_tag }} TYPE: ${{ inputs.type }} REGISTRY: ${{ inputs.registry }} - TARGET_DIR: $TARGET_PATH + TARGET_PATH: $TARGET_PATH - name: Commit and push changes run: ${{ github.action_path }}/commit_changes.sh @@ -64,7 +64,7 @@ runs: TYPE: ${{ inputs.type }} GITHUB_TOKEN: ${{ inputs.github_token }} TARGET_REPO: ${{ inputs.target_repo }} - TARGET_DIR: $TARGET_PATH + TARGET_PATH: $TARGET_PATH TARGET_BRANCH: ${{ inputs.target_branch }} - name: Clean up target repo folder diff --git a/actions/update-artifacts-file/commit_changes.sh b/actions/update-artifacts-file/commit_changes.sh index 8316862b..4cba889b 100755 --- a/actions/update-artifacts-file/commit_changes.sh +++ b/actions/update-artifacts-file/commit_changes.sh @@ -1,11 +1,9 @@ #!/bin/bash -cd "$TARGET_DIR" +cd "$TARGET_PATH" git config user.name "mapcolonies[bot]" git config user.email "devops[bot]@mapcolonies.com" -git checkout "$TARGET_BRANCH" - git add "$DOMAIN/artifacts.json" git commit -m "chore: update artifacts.json for $DOMAIN" -m "with $TYPE artifact: $ARTIFACT_NAME:$ARTIFACT_TAG" || echo "Nothing to commit" diff --git a/actions/update-artifacts-file/modify_artifacts.sh b/actions/update-artifacts-file/modify_artifacts.sh index 30919caa..a40ed936 100755 --- a/actions/update-artifacts-file/modify_artifacts.sh +++ b/actions/update-artifacts-file/modify_artifacts.sh @@ -1,5 +1,5 @@ #!/bin/bash -ARTIFACTS_PATH="$TARGET_DIR/$DOMAIN/artifacts.json" +ARTIFACTS_PATH="$TARGET_PATH/$DOMAIN/artifacts.json" # Make sure the directory exists mkdir -p "$(dirname "$ARTIFACTS_PATH")"