{"id":44002837,"url":"https://github.com/developer-friendly/selective-builds-actions","last_synced_at":"2026-02-07T13:04:24.811Z","repository":{"id":251364283,"uuid":"837144608","full_name":"developer-friendly/selective-builds-actions","owner":"developer-friendly","description":"GitHub Action to identity changed directories/applications for selective builds.","archived":false,"fork":false,"pushed_at":"2026-01-29T11:47:44.000Z","size":8764,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-29T15:30:19.204Z","etag":null,"topics":["build","build-automation","build-tool","build-tools","github-actions","monolith","monorepo","selective-build","selective-builds"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developer-friendly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-02T10:00:35.000Z","updated_at":"2025-08-12T07:55:27.000Z","dependencies_parsed_at":"2024-12-10T02:28:34.299Z","dependency_job_id":"ab8e0bf4-6319-478a-a82a-717a1c63bc02","html_url":"https://github.com/developer-friendly/selective-builds-actions","commit_stats":null,"previous_names":["developer-friendly/selective-builds-actions"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/developer-friendly/selective-builds-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-friendly%2Fselective-builds-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-friendly%2Fselective-builds-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-friendly%2Fselective-builds-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-friendly%2Fselective-builds-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer-friendly","download_url":"https://codeload.github.com/developer-friendly/selective-builds-actions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-friendly%2Fselective-builds-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29194494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","build-automation","build-tool","build-tools","github-actions","monolith","monorepo","selective-build","selective-builds"],"created_at":"2026-02-07T13:04:24.194Z","updated_at":"2026-02-07T13:04:24.801Z","avatar_url":"https://github.com/developer-friendly.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Selective Build Actions\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Selective Build Actions](#selective-build-actions)\n  - [Example - Build Docker](#example---build-docker)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\nThis action will perform a hash function on the first depth of directories\nspecified at `path`, calculate a unique SHA256 hash on the files inside, and\ngenerate a unique string for each directory.\n\nIt then uses that string to compare future CI runs against he one computed\nbefore, signaling a change in the target directory, possibly allowing a further\njob to execute a build of the application in the change directory.\n\nIt is useful for selective builds on monorepos when it is desired and costly\njustified to build only the directories that have changed.\n\nIt does not hold any opinions on how you build your apps; you are free to pick\nwhatever's best for your stack. However, for the purpose of demonstration, you\nwill find a Docker build example below.\n\nThis action relies on GitHub Action's dynamic\n[matrix](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-a-matrix-for-your-jobs),\na topic that has been covered in\n[here](https://developer-friendly.blog/2024/03/09/github-actions-dynamic-matrix/).\n\n## Example - Build Docker\n\n```yaml\nname: ci\n\non:\n  push:\n    branches:\n      - main\n  schedule:\n    - cron: \"0 0 * * *\"\n\njobs:\n  prepare:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n    outputs:\n      matrix: ${{ steps.matrix.outputs.matrix }}\n      length: ${{ steps.matrix.outputs.length }}\n    steps:\n      - uses: actions/checkout@v4\n        name: Checkout\n      - id: matrix\n        name: Discover changed services\n        uses: developer-friendly/selective-builds-actions@v1\n        with:\n          redis-host: ${{ secrets.REDIS_HOST }}\n          redis-port: ${{ secrets.REDIS_PORT }}\n          redis-password: ${{ secrets.REDIS_PASSWORD }}\n          redis-ssl: ${{ secrets.REDIS_SSL }}\n          exclusions: |\n            .git\n            .github\n          inclusions: |\n            frontend\n            backend\n            api\n\n  build:\n    needs: prepare\n    runs-on: ubuntu-latest\n    if: needs.prepare.outputs.length \u003e 0\n    strategy:\n      fail-fast: false\n      matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}\n    permissions:\n      contents: read\n      packages: write\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v3\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v3\n      - name: Login to GitHub Container Registry\n        uses: docker/login-action@v3\n        with:\n          password: ${{ secrets.GITHUB_TOKEN }}\n          registry: ghcr.io\n          username: ${{ github.actor }}\n      - name: Pre-process image name\n        id: image-name\n        run: |\n          name=$(echo ${{ matrix.directory }} | sed 's/.*\\///')\n          echo \"name=$name\" \u003e\u003e $GITHUB_OUTPUT\n      - id: meta\n        name: Docker metadata\n        uses: docker/metadata-action@v5\n        with:\n          images: ghcr.io/${{ github.repository }}/${{ steps.image-name.outputs.name }}\n      - id: build-push\n        name: Build and push\n        uses: docker/build-push-action@v6\n        with:\n          cache-from: type=gha\n          cache-to: type=gha,mode=max\n          context: ${{ matrix.directory }}\n          labels: ${{ steps.meta.outputs.labels }}\n          platforms: linux/amd64,linux/arm64\n          push: true\n          tags: |\n            ${{ steps.meta.outputs.tags }}\n\n  finalize:\n    runs-on: ubuntu-latest\n    needs: build\n    permissions:\n      contents: read\n    steps:\n      - uses: actions/checkout@v4\n        name: Checkout\n      - id: matrix\n        name: Discover changed services\n        uses: developer-friendly/selective-builds-actions@v1\n        with:\n          redis-host: ${{ secrets.REDIS_HOST }}\n          redis-port: ${{ secrets.REDIS_PORT }}\n          redis-password: ${{ secrets.REDIS_PASSWORD }}\n          redis-ssl: ${{ secrets.REDIS_SSL }}\n          mode: submit\n          exclusions: |\n            .git\n            .github\n          inclusions: |\n            frontend\n            backend\n            api\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-friendly%2Fselective-builds-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper-friendly%2Fselective-builds-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-friendly%2Fselective-builds-actions/lists"}