Skip to content

Commit

Permalink
Merge pull request #187 from catalystneuro/check_for_changelog_updates
Browse files Browse the repository at this point in the history
Changelog Detector
  • Loading branch information
CodyCBakerPhD authored Oct 22, 2022
2 parents 068a480 + b0f5d1c commit ba57387
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/assess-file-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ on:
CONVERSION_GALLERY_CHANGED:
description: "Whether or not the files under /docs/conversion_examples_gallery/ were changed."
value: ${{ jobs.build.outputs.CONVERSION_GALLERY_CHANGED }}
CHANGELOG_UPDATED:
description: "Whether or the CHANGELOG.md file was updated."
value: ${{ jobs.build.outputs.CHANGELOG_UPDATED }}

jobs:
build:
runs-on: ubuntu-latest
# Map the job outputs to step outputs
outputs:
SOURCE_CHANGED: ${{ steps.source-changed.outputs.SOURCE_CHANGED }}
CONVERSION_GALLERY_CHANGED: ${{ steps.source-changed.outputs.CONVERSION_GALLERY_CHANGED }}
SOURCE_CHANGED: ${{ steps.assess-changes.outputs.SOURCE_CHANGED }}
CONVERSION_GALLERY_CHANGED: ${{ steps.assess-changes.outputs.CONVERSION_GALLERY_CHANGED }}
CHANGELOG_UPDATED: ${{ steps.assess-changes.outputs.CHANGELOG_UPDATED }}

name: Test changed-files
steps:
Expand All @@ -30,24 +34,32 @@ jobs:
uses: tj-actions/[email protected]

- name: Assess Source Code Changes
id: source-changed
id: assess-changes
run: |
echo "::set-output name=SOURCE_CHANGED::false"
echo "::set-output name=CONVERSION_GALLERY_CHANGED::false"
echo "SOURCE_CHANGED=false" >> $GITHUB_OUTPUT
echo "CONVERSION_GALLERY_CHANGED=false" >> $GITHUB_OUTPUT
echo "CHANGELOG_UPDATED=false" >> $GITHUB_OUTPUT
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo $file
if [[ $file == "src/"* || $file == "tests/"* || $file == "requirements-minimal.txt" || $file == "requirements-testing.txt" || $file == "setup.py" ]]
then
echo "Source changed"
echo "::set-output name=SOURCE_CHANGED::true"
echo "SOURCE_CHANGED=true" >> $GITHUB_OUTPUT
else
echo "Source not changed"
fi
if [[ $file == "docs/conversion_examples_gallery/"* ]]
then
echo "Conversion gallery changed"
echo "::set-output name=CONVERSION_GALLERY_CHANGED::true"
echo "CONVERSION_GALLERY_CHANGED=true" >> $GITHUB_OUTPUT
else
echo "Conversion gallery not changed"
fi
if [[ $file == "CHANGELOG.md" ]]
then
echo "Changelog updated"
echo "CHANGELOG_UPDATED=true" >> $GITHUB_OUTPUT
else
echo "Changelog not updated"
fi
done
14 changes: 13 additions & 1 deletion .github/workflows/deploy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ jobs:
uses: styfle/[email protected]

assess-file-changes:
uses: catalystneuro/neuroconv/.github/workflows/assess-file-changes.yml@main
uses: catalystneuro/neuroconv/.github/workflows/assess-file-changes.yml@check_for_changelog_updates

detect-changelog-updates:
needs: assess-file-changes
name: Auto-detecting CHANGELOG.md updates
runs-on: ubuntu-latest
steps:
- if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'true' }}
run: echo "CHANGELOG.md has been updated."
- if: ${{ needs.assess-file-changes.outputs.CHANGELOG_UPDATED == 'false' }}
run: |
echo "CHANGELOG.md has not been updated."
0
run-tests:
needs: assess-file-changes
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Added a set of dev branch gallery tests for PyNWB, HDMF, SI, and NEO. [PR #113](https://github.com/catalystneuro/neuroconv/pull/113)
* Added tests for the `TypeError` and `ValueError` raising for the new `starting_frames` argument of `MovieDataInterface.run_conversion()`. [PR #113](https://github.com/catalystneuro/neuroconv/pull/113)
* Added workflow for automatic detection of CHANGELOG.md updates for PRs. [PR #187](https://github.com/catalystneuro/neuroconv/pull/187)

### Fixes

Expand Down

0 comments on commit ba57387

Please sign in to comment.