s0 / git-publish-subdir-action

GitHub Action to push a subdirectory as a branch to any git repo (e.g. for GitHub Pages)
https://github.com/marketplace/actions/push-git-subdirectory-as-branch
MIT License
208 stars 36 forks source link

Add author environment variables #78

Closed promise closed 1 year ago

promise commented 1 year ago

Context

This PR has the same changes as https://github.com/s0/git-publish-subdir-action/pull/75 but the PR author deleted their fork :( - I've decided to make my own fork with the same changes for my own purposes, as well as create a PR to hopefully get it merged as well 🙏

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 COMMIT_NAME and COMMIT_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 }}
    COMMIT_NAME: "github-actions[bot]"
    COMMIT_EMAIL: "github-actions[bot]@users.noreply.github.com"

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Merging #78 (a5c652c) into develop (b356a91) will increase coverage by 0.10%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop      #78      +/-   ##
===========================================
+ Coverage    89.94%   90.05%   +0.10%     
===========================================
  Files            1        1              
  Lines          189      191       +2     
  Branches        37       39       +2     
===========================================
+ Hits           170      172       +2     
  Misses          14       14              
  Partials         5        5              
Impacted Files Coverage Δ
action/src/index.ts 90.05% <100.00%> (+0.10%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.