-
Notifications
You must be signed in to change notification settings - Fork 41
Add NEWS.md and news reminder workflow #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
498a6af
523f577
ca45a1c
a3cf94d
af22ef4
38cf2c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Auto-bump Version on Merge | ||
|
|
||
| # This triggers ONLY when code is pushed directly to master | ||
| # (which includes when a Pull Request is merged into it). | ||
| on: | ||
| push: | ||
| branches: | ||
| - master # If your default branch is 'main', change this to 'main' | ||
|
|
||
| jobs: | ||
| bump-version: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # Required so the bot can push the new commit to your repo | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Calculate and Update Version | ||
| run: | | ||
| # 1. Extract current version from the DESCRIPTION file | ||
| CURRENT_VERSION=$(grep -i "^Version:" DESCRIPTION | awk '{print $2}') | ||
|
|
||
| # SECURITY CHECK: Ensure it strictly matches a version number format (e.g., 0.17.0 or 0.17.0.9000) | ||
| if [[ ! "$CURRENT_VERSION" =~ ^[0-9]+(\.[0-9]+)+$ ]]; then | ||
| echo "❌ Error: Invalid version format in DESCRIPTION: '$CURRENT_VERSION'" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # 2. Split the version string by periods into an array | ||
| IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION" | ||
|
|
||
| # 3. Increment the very last number by 1 | ||
| LAST_INDEX=$((${#VERSION_PARTS[@]} - 1)) | ||
| VERSION_PARTS[$LAST_INDEX]=$((VERSION_PARTS[$LAST_INDEX] + 1)) | ||
|
|
||
| # 4. Stitch the version string back together | ||
| NEW_VERSION=$(IFS='.'; echo "${VERSION_PARTS[*]}") | ||
|
|
||
| echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION" | ||
|
|
||
| # 5. Safely replace the old version with the new version in the file | ||
| sed -i "s/^Version: [0-9.]\+/Version: $NEW_VERSION/i" DESCRIPTION | ||
|
|
||
| # 6. Securely pass the new version to the next step for the commit message | ||
| cat <<EOF >> "$GITHUB_ENV" | ||
| NEW_VERSION=$NEW_VERSION | ||
| EOF | ||
|
|
||
| - name: Commit and Push | ||
| run: | | ||
| # Configure Git to act as the official GitHub Actions bot | ||
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
|
|
||
| # Stage the changed file | ||
| git add DESCRIPTION | ||
|
|
||
| # Check if there are actually changes to commit (prevents errors if version didn't change) | ||
| if ! git diff-index --quiet HEAD; then | ||
| # The [skip ci] flag is CRITICAL. It tells GitHub NOT to trigger | ||
| # another workflow run from this automated commit, preventing infinite loops. | ||
| git commit -m "chore: auto-bump version to ${{ env.NEW_VERSION }} [skip ci]" | ||
| git push | ||
| echo "✅ Successfully bumped version and pushed to master." | ||
| else | ||
| echo "No changes needed." | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Remind NEWS.md Update | ||
|
|
||
| # We only run this when the PR is first opened so the bot doesn't | ||
| # spam the contributor with comments on every single new commit. | ||
| on: | ||
| pull_request: | ||
| types: [opened] | ||
|
|
||
| jobs: | ||
| remind-news: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write # Required so the bot can leave a comment | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check if NEWS.md was modified | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| # Get the list of changed files | ||
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} HEAD) | ||
|
|
||
| # Check if NEWS.md is in that list | ||
| if echo "$CHANGED_FILES" | grep -q "^NEWS\.md$"; then | ||
| echo "✅ NEWS.md was updated. No reminder needed." | ||
| exit 0 | ||
| else | ||
| echo "⚠️ NEWS.md not updated. Posting a friendly reminder..." | ||
|
|
||
| # Use the GitHub CLI to post a comment directly to the PR | ||
| gh pr comment ${{ github.event.pull_request.number }} --body "👋 **Friendly reminder:** It looks like \`NEWS.md\` wasn't updated in this Pull Request. | ||
|
|
||
| If your changes include bug fixes, new features, or UI tweaks, please consider adding a quick note to the \`# jaspYourModule (development version)\` section so our users know about your awesome work! *(If this is just a minor typo fix, feel free to ignore this message.)*" | ||
|
|
||
| # We exit with 0 (success) so the check turns green and does NOT block the PR | ||
|
Comment on lines
+34
to
+39
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this a better approach than actions/github-script? |
||
| exit 0 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # jaspModuleTemplate Changelog | ||
|
|
||
| > **HOW TO READ AND UPDATE THIS CHANGELOG:** | ||
| > | ||
| > This document follows a modified [Keep a Changelog](https://keepachangelog.com/) format adapted for the R/JASP ecosystem. Releases are listed in reverse chronological order (newest first). | ||
| > As an example see [jaspModuleTemplate](https://github.com/RensDofferhoff/jaspModuleTemplate/blob/master/NEWS.md) | ||
| > * **Adding New Changes (For Contributors):** All new commits should be logged at the very top of the file under the `# jaspModuleTemplate (development version)` header. Place your bullet point under the appropriate category (`## Added`, `## Fixed`, etc.). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about we use : feat., fix., enh., test.,. chore...in NEWS.md. in this way we can pick out the major user-visible change in main JASP's release news.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually like the taxonomy |
||
| > * **Issue References:** Please reference the relevant GitHub Issue (if any) at the end of your line (e.g., `(Issue #123)`). | ||
| > * **Format Categories:** > * **Added:** New template features, QML examples, or build tools. | ||
| > * **Changed:** Updates to default configurations, boilerplate code, or dependencies. | ||
| > * **Fixed:** Bug fixes in the build pipeline, R wrappers, or QML layouts. | ||
| > * **Deprecated / Removed:** Outdated template components or legacy code. | ||
|
|
||
| --- | ||
|
|
||
| # jaspModuleTemplate (development version) | ||
|
|
||
| ## Added | ||
| * Added a "Raincloud Plot" option to visualize data distributions alongside summary statistics (Issue #45). | ||
| * Added Welch's t-test option | ||
|
|
||
| ## Changed | ||
| * Reorganized the "Assumption Checks" menu to group homogeneity and normality tests together for better usability (Issue #51). | ||
|
|
||
| ## Fixed | ||
| * Fixed a fatal error where the analysis would crash if a user assigned a variable containing entirely missing values (`NA`) to the grouping factor (Issue #53). | ||
|
|
||
| --- | ||
|
|
||
| # jaspModuleTemplate 0.17.0 | ||
|
|
||
| ## Added | ||
| * Included support for robust standard errors (HC3 estimators) via the `sandwich` package (Issue #39). | ||
| * Added full interface translations for German and French (Issue #38). | ||
|
|
||
| ## Changed | ||
| * The default color palette for all plots has been updated to be colorblind-friendly (Issue #43). | ||
| * The main results table now defaults to displaying 95% Confidence Intervals for effect sizes. | ||
|
|
||
| ## Deprecated | ||
| * The legacy `jaspCreateLegacyPlot()` function used for backwards compatibility with older state files is marked for removal. Module developers should migrate to the modern plotting API (Issue #30).custom QML components (Issue #30). | ||
|
Comment on lines
+16
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this contain the actual updates jaspModuleTemplate? :p |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a PR already update the version, this would do it twice, no?