git-publish-subdir-action icon indicating copy to clipboard operation
git-publish-subdir-action copied to clipboard

Add `USERNAME` and `EMAIL` env variables

Open ozaner opened this issue 3 years ago • 4 comments

Added support for a custom username and email to be used in the autogenerated commit. Just set USERNAME and EMAIL respectively in the env variables.

Context

The autogenerated commit this action produces always uses the username and email of the pusher. This commit adds support for changing these variables using the USERNAME and EMAIL environment variables. My particular use case was to mark these autogenerated commits as being created by the github-actions bot:

- name: Commit to Output
  uses: s0/git-publish-subdir-action@develop
  env:
    REPO: self
    BRANCH: output
    FOLDER: outputDir
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    USERNAME: "github-actions[bot]"
    EMAIL: "github-actions[bot]@users.noreply.github.com"

Checklist

ozaner avatar Jul 29 '22 07:07 ozaner

Hiya, thanks for the contribution, this is a nice addition.

Before we can get this merged in though, we need to add a few things to this PR:

  • [x] Update the README with instructions on how to use these parameters.
  • [x] Regenerate the action code (run npm run build from action/).
  • [x] Add unit-tests that cover the use of these parameters.

I can help you with any of the above or do it myself, but happy to let you have a go if you'd prefer to do it?

s0 avatar Jul 31 '22 18:07 s0

I've updated the readme, regenerated the action code, and added a unit test. Not too familiar with typescript (or even javascript) so I might be missing something.

ozaner avatar Aug 02 '22 13:08 ozaner

@s0 bump

promise avatar Aug 22 '22 11:08 promise

(also sorry for not including these change requests in the first review, I had some time to think about the naming and only remembered after I saw it in my notifications again)

s0 avatar Aug 23 '22 07:08 s0

The USERNAME and EMAIL env variables have been renamed, and the readme updated.

ozaner avatar Aug 25 '22 13:08 ozaner