Skip to content

Commit

Permalink
Merge pull request #126 from afshin/fix-changelog
Browse files Browse the repository at this point in the history
Fix Generate Changelog Action
  • Loading branch information
Steven Silvester authored Aug 27, 2021
2 parents 35213e0 + 5751c65 commit 903fd1e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
required: true
branch:
description: The branch or reference name to filter pull requests by
required: false
required: true
convert_to_rst:
description: Whether to convert to RST
required: false
Expand Down Expand Up @@ -53,8 +53,8 @@ jobs:
export RH_SINCE=${{ github.event.inputs.since }}
export RH_REF=refs/heads/${RH_BRANCH}
export RH_REPOSITORY=${{ github.event.inputs.target }}
export INPUT_UNTIL=${{ github.event.inputs.until }}
export INPUT_CONVERT_TO_RST=${{ github.event.inputs.convert_to_rst }}
export RH_UNTIL=${{ github.event.inputs.until }}
export RH_CONVERT_TO_RST=${{ github.event.inputs.convert_to_rst }}
python -m jupyter_releaser.actions.generate-changelog
cat CHANGELOG_ENTRY.md
- uses: actions/upload-artifact@v2
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,22 @@ jobs:
RH_REPOSITORY: jupyter-server/jupyter_releaser
RH_BRANCH: master
RH_SINCE: v0.3.0
INPUT_UNTIL: v0.4.0
RH_UNTIL: v0.4.0
run: |
set -eux
python -m jupyter_releaser.actions.generate-changelog
cat CHANGELOG_ENTRY.md
# Check for version entry in between the two versions and one outside
cat CHANGELOG_ENTRY.md | grep -q "#95"
cat CHANGELOG_ENTRY.md | grep -q "compare/v0.3.0...v0.4.0"
# make sure it works with different settings
export RH_SINCE=
export RH_UNTIL=
export RH_CONVERT_TO_RST=true
sudo apt-get install pandoc
pip install pypandoc
python -m jupyter_releaser.actions.generate-changelog
cat CHANGELOG_ENTRY.md
- name: Coverage
run: |
codecov
4 changes: 2 additions & 2 deletions jupyter_releaser/actions/generate-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
branch = os.environ.get("RH_BRANCH")
ref = os.environ.get("RH_REF")
since = os.environ.get("RH_SINCE")
until = os.environ.get("INPUT_UNTIL")
convert_to_rst = os.environ.get("INPUT_CONVERT_TO_RST", "")
until = os.environ.get("RH_UNTIL")
convert_to_rst = os.environ.get("RH_CONVERT_TO_RST", "")

print("Generating changelog")
print("target:", target)
Expand Down
4 changes: 3 additions & 1 deletion jupyter_releaser/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_version_entry(
The new version
since: str
Use PRs with activity since this date or git reference
until: str, option
until: str, optional
Use PRs until this date or git reference
auth : str, optional
The GitHub authorization token
Expand All @@ -90,6 +90,8 @@ def get_version_entry(

if until:
until = until.replace("%", "")
else:
until = None

md = generate_activity_md(
repo,
Expand Down

0 comments on commit 903fd1e

Please sign in to comment.