Skip to content

Commit

Permalink
Merge pull request #19 from saadmk11/optional-username-email
Browse files Browse the repository at this point in the history
Make Username and Email input optional and default to github-actions[bot]
  • Loading branch information
saadmk11 authored Sep 7, 2020
2 parents 685c1d3 + 68f4229 commit 6f22920
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ Put this step inside your ``.github/workflows/workflow.yml`` file:
- name: Run Changelog CI
uses: saadmk11/[email protected]
with:
# optional, you can provide any name for your changelog file,
# Optional, you can provide any name for your changelog file,
# defaults to ``CHANGELOG.md`` if not provided.
changelog_filename: MY_CHANGELOG.md
# optional, only required when you want to
# Optional, only required when you want to
# group your changelog by labels and titles
config_file: changelog-ci-config.json
# Optional, This will be used to configure git
# defaults to ``github-actions[bot]`` if not provided.
committer_username: 'test'
committer_email: '[email protected]'
env:
# This will be used to configure git
# you can use secrets for it as well
USERNAME: 'test'
EMAIL: '[email protected]'
# optional, only required for ``private`` repositories
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```
Expand Down Expand Up @@ -146,8 +146,6 @@ jobs:
changelog_filename: CHANGELOG.md
config_file: changelog-ci-config.json
env:
USERNAME: ${{secrets.USERNAME}}
EMAIL: ${{secrets.EMAIL}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```
Expand Down
8 changes: 8 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ inputs:
config_file:
description: 'Location of the config JSON file'
required: false
committer_username:
description: 'Username of that user who will commit'
required: false
default: 'github-actions[bot]'
committer_email:
description: 'Email Address of that user who will commit'
required: false
default: '41898282+github-actions[bot]@users.noreply.github.com'
runs:
using: 'docker'
image: 'Dockerfile'
6 changes: 3 additions & 3 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

git config user.name ${USERNAME}
git config user.email ${EMAIL}

git fetch --prune --unshallow
git checkout ${GITHUB_HEAD_REF}

python /scripts/changelog-ci.py

git config user.name ${INPUT_COMMITTER_USERNAME}
git config user.email ${INPUT_COMMITTER_EMAIL}

git add ${INPUT_CHANGELOG_FILENAME}
git commit -m "Added Changelog"
git push -u --force origin HEAD:${GITHUB_HEAD_REF}

0 comments on commit 6f22920

Please sign in to comment.