{"id":22199276,"url":"https://github.com/babbel/publish-build-metadata","last_synced_at":"2026-04-21T12:02:58.908Z","repository":{"id":37095094,"uuid":"364867319","full_name":"babbel/publish-build-metadata","owner":"babbel","description":"Collects build artifacts metadata and publishes them to DynamoDB","archived":false,"fork":false,"pushed_at":"2024-04-22T10:52:12.000Z","size":2153,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":39,"default_branch":"main","last_synced_at":"2024-04-22T12:02:30.362Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babbel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-06T10:11:02.000Z","updated_at":"2024-05-09T05:57:26.877Z","dependencies_parsed_at":"2024-01-12T12:22:22.156Z","dependency_job_id":"dd99ca63-ceb0-4308-a5df-5e40f57d5a19","html_url":"https://github.com/babbel/publish-build-metadata","commit_stats":{"total_commits":54,"total_committers":7,"mean_commits":7.714285714285714,"dds":0.7037037037037037,"last_synced_commit":"d91e419008676a0339e63bb025712dadbf437d82"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpublish-build-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpublish-build-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpublish-build-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babbel%2Fpublish-build-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babbel","download_url":"https://codeload.github.com/babbel/publish-build-metadata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245372216,"owners_count":20604488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actions"],"created_at":"2024-12-02T15:13:49.579Z","updated_at":"2026-04-21T12:02:58.895Z","avatar_url":"https://github.com/babbel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# publish-build-metadata\n\nInternal Babbel tool to collect build artifacts metadata.\n\n## Usage\n\nIn your project workflow, after build artifact was published.\n\nAll `AWS_` secrets should be already set and ready to use.\n\n### Standalone project example\n\n```yaml\npermissions:\n  contents: read\n  id-token: write\n\njobs:\n  name_of_the_job:\n    #\n    # ...\n    #\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}\n          aws-region: ${{ vars.AWS_REGION }}\n      #\n      # ... build \u0026 publish the artifact\n      #\n      - uses: babbel/publish-build-metadata@v1\n        with:\n          meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}\n```\n\n### Microverse example, all slices at once\n\n```yaml\npermissions:\n  contents: read\n  id-token: write\n\njobs:\n  name_of_the_job:\n    #\n    # ...\n    #\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}\n          aws-region: ${{ vars.AWS_REGION }}\n      #\n      # ... build \u0026 publish the artifact\n      #\n      - uses: babbel/publish-build-metadata@v1\n        with:\n          meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}\n          slices: 'api, consumer.kinesis, consumer.firehose'\n```\n\n### Microverse example, one slice at a time\n\nFor example in case you have jobs matrix.\n\n```yaml\npermissions:\n  contents: read\n  id-token: write\n\njobs:\n  name_of_the_job:\n    #\n    # ...\n    #\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}\n          aws-region: ${{ vars.AWS_REGION }}\n      #\n      # ... build \u0026 publish the artifact\n      #\n      - uses: babbel/publish-build-metadata@v1\n        with:\n          meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}\n          slices: 'api' # or ${{ matrix.function_name }}\n```\n\n### When custom Commit SHA\n\nSometimes you might trigger an automatic build which fetches a different branch. In such case `GITHUB_SHA` differs from actual Commit SHA that the build is working on.\n\nIn such case you can override `GITHUB_SHA` by passing extra parameter:\n\n```yaml\npermissions:\n  contents: read\n  id-token: write\n\njobs:\n  name_of_the_job:\n    #\n    # ...\n    #\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}\n          aws-region: ${{ vars.AWS_REGION }}\n      #\n      # ... build \u0026 publish the artifact\n      #\n      - uses: babbel/publish-build-metadata@v1\n        with:\n          meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}\n          sha: ${{ env.MY_CUSTOM_COMMIT_SHA }}\n```\n\nUsually with above it will be handy to be able to specify the branch name as well, so the full example would look like:\n\n```yaml\npermissions:\n  contents: read\n  id-token: write\n\njobs:\n  name_of_the_job:\n    #\n    # ...\n    #\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}\n          aws-region: ${{ vars.AWS_REGION }}\n      #\n      # ... build \u0026 publish the artifact\n      #\n      - uses: babbel/publish-build-metadata@v1\n        with:\n          meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}\n          sha: ${{ env.MY_CUSTOM_COMMIT_SHA }}\n          branch: ${{ env.MY_CUSTOM_BRANCH }}\n```\n\n### Pull-Request triggered workflows\n\nFor [PR-triggered workflows](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request), the branch (`GITHUB_REF`) and commit (`GITHUB_SHA`) which will be deployed by default are the PR merge branch and its last merge commit respectively. This merge branch and commit are auto-generated by Github.\n\nFor more details, see this [thread](https://github.com/orgs/community/discussions/26325). Also, here's a great [article](https://medium.com/@lizjohnson_83228/the-difference-between-push-and-pull-request-triggers-in-github-d7c0f2bc19db) on the behaviour of push vs pull-request triggered workflows.\n\nIn the Deploy App, PR-triggered workflows can be identified by:\n- Branch names in the format: `refs/pull/\u003cPR number\u003e/merge` e.g `refs/pull/123/merge`\n- Commit messages in the following format:\n`Merge 51a13eb7fad0401d4ef5d01a98c729c7e231fe8e into 912858b8fb3fc0318a892b1b7e69ee72592717bb (388611d)`.\n\nwhere:\n- `51a13eb...` is the head commit on your feature branch,\n- `912858b...` is the head commit on the `main` branch and\n- `388611d...` is the PR merge commit auto-generated by Github.\n\nTo display a more meaningful commit message in the Deploy App, a `commit_message_sha` input may be provided. The `publish-build-metadata` action will pass the commit message corresponding to the provided `commit_message_sha` to the Deploy App.\n\n**NB: This `commit_message_sha` input is purely for display purposes in the Deploy App. The commit which will be deployed remains the GITHUB_SHA commit on the GITHUB_REF branch. This may cause some confusion, so keep this in mind when using it.**\n\n```yaml\npermissions:\n  contents: read\n  id-token: write\n\njobs:\n  name_of_the_job:\n    # ...\n    #\n    steps:\n      # NB: actions/checkout fetches only a `single` commit by default.\n      # For PR-triggered workflows, this will be the PR merge commit auto-generated by Github.\n      # Set `fetch-depth` to (at least) 2 so it also fetches the head commit on your feature branch.\n      - name: Checkout\n        uses: actions/checkout@v6\n        with:\n          fetch-depth: 2\n\n      # ...\n\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v1\n        with:\n          role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}\n          aws-region: ${{ vars.AWS_REGION }}\n\n      #\n      # ... build \u0026 publish the artifact\n      #\n      - uses: babbel/publish-build-metadata@v1\n        with:\n          meta_table_arn: ${{ vars.AWS_META_TABLE_ARN }}\n          commit_message_sha: ${{ github.event.pull_request.head.sha || github.sha }}\n```\n\nIn the sample above, `github.event.pull_request.head.sha` refers to the head commit on your `feature branch`.\n\nIf it is not a PR-triggered workflow (e.g the workflow is triggered on `push`), then `github.event.pull_request.head.sha` will be absent from the Github context, so it will fall back to `github.sha`.\n\nNB: If you don't pass `fetch-depth: 2` to `actions/checkout`, your CI run will fail with:\n*Error: The process '/usr/bin/git' failed with exit code 128.*\n\n## Contribute\n\nPrep the project, it runs against nodejs v20, when using `asdf-vm` just hit `asdf install`. Then install the packages\n\n```\nnpm ci\n```\n\nRun the tests\n\n```\nmake test\n```\n\nOr better run the whole build all the time, this way you won't forget to run it before commit\n\n```\nmake build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Fpublish-build-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabbel%2Fpublish-build-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabbel%2Fpublish-build-metadata/lists"}