aws-actions / aws-secretsmanager-get-secrets

MIT No Attribution
142 stars 38 forks source link

Package step with email #138

Closed jirkafajfr closed 3 months ago

jirkafajfr commented 3 months ago

Every time we merge pull request, the packaging step runs and regenerates the dist folder. This step is important, otherwise we're bundling just old code under new tags. As of writing this PR, the latest change is 3 months old in the dist folder, but the commit history says that the last change on the repo was made 25 days ago.

When I drill to the package step (example). Some iterations silently fail on:

Run git config --global user.name "GitHub Actions"
Author identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'runner@fv-az566-[9](https://github.com/aws-actions/aws-secretsmanager-get-secrets/actions/runs/9036808082/job/24834486471#step:4:10)5.(none)')
No changes to commit
Everything up-to-date

This seems to be intermittent. I am simply adding user.email option. I've tested this on my forked repo, and it seemed to succeed.

jirkafajfr commented 3 months ago

Will had an idea of putting in the last commit author (name, including email) as the author of automatically generated commit. You can see the test run here.

Run git config user.name "$(git log -n 1 --pretty=format:%an)"
  git config user.name "$(git log -n 1 --pretty=format:%an)"
  git config user.email "$(git log -n 1 --pretty=format:%ae)"
  git add dist/
  git commit -m "chore: Update dist" || echo "No changes to commit"
  git push origin HEAD:main
  shell: /usr/bin/bash -e {0}
[main 48170[2](https://github.com/jirkafajfr/aws-secretsmanager-get-secrets/actions/runs/9374729477/job/25811430029#step:4:2)d] chore: Update dist
 6 files changed, 162909 insertions(+), 74785 deletions(-)
To https://github.com/jirkafajfr/aws-secretsmanager-get-secrets
   51[3](https://github.com/jirkafajfr/aws-secretsmanager-get-secrets/actions/runs/9374729477/job/25811430029#step:4:3)f620..481702d  HEAD -> main

This is the way how the commit log looks now.

image