Skip to content

Commit 52db24e

Browse files
v1.3.0 (#274)
Closes #272 Closes #269 Closes #191 (hopefully) New template version checklist: - [x] I have updated CITATION and CHANGELOG as appropriate. - [x] I have updated lab-website-template-docs as appropriate. Pending change request: https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/components/list - [x] I have checked the testbed as appropriate. --- - use `name` field for all debug/logging steps in workflows - use `jwalton/gh-find-current-pr` to get PR number to be more reliable (in rare cases, `github.event.number` can be empty) - fix bug in "first time setup" workflow where `description` gets appended to `user` due to missing `\n` in printf - rename workflows from `.yml` to `.yaml` for consistency - remove useless "build preview" workflow run in "on schedule" † - dont run "update citations" workflow on PR close, which should hopefully avoid issues discussed in #191. in my testing on a fork (vincerubinetti/lab-website-template), it does. need to use step-level `if` skipping instead of job-level or workflow-level because of [this issue](actions/runner#491 (comment)). - when "on schedule" workflow opens a PR, add hint in body of the PR on how to trigger the live preview workflow - use the `xml_escape` liquid filter wherever a user/third-party provided field is used in an HTML attribute to prevent special characters breaking HTML rendering. example: `aria-label="{{ citation.title }}"` and `citation.title` is `"Lorem Ipsum" dataset`, causing attribute to prematurely close. - change `data_filter` to accept Ruby expressions instead of custom syntax. use Ruby `eval` and define each field in the item as a local variable, e.g. `{"animal": "cat"}` lets you use `filter="animal == 'cat'"`. - fix heading anchor styles - add styles for `<details>` element - fix logo shrinking/growing css bugs † due to a [github limitation](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs), it wouldn't not run anyway on the auto-created PR. the user must close/reopen the PR, then the regular "on pr" workflow (which includes running "build preview") will run. i've already [updated the docs to talk about this](https://greene-lab.gitbook.io/lab-website-template-docs/basics/citations#periodic-updates). from now on, let's treat auto-opening PR as the only supported way. previously i considered that the user could change `open-pr` to `false` to have "on schedule" commit updated citations directly to `main`, but let's nix that to maintain simplicity. it's probably better that we force the user to review the changes before pushing them to their live site anyway. if we did want to support that in the future, the "build preview" run i removed would have to be changed to a "build site", since we'd want to be re-building the `main` branch version of the site, not a preview for a PR. --------- Co-authored-by: Faisal Alquaddoomi <falquaddoomi@gmail.com>
1 parent 5afb459 commit 52db24e

36 files changed

+223
-112
lines changed

.github/workflows/build-preview.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
# for debugging
25-
- uses: crazy-max/ghaction-dump-context@v2
24+
- name: Debug dump
25+
uses: crazy-max/ghaction-dump-context@v2
2626

2727
- name: Checkout branch contents
2828
uses: actions/checkout@v4
@@ -42,14 +42,22 @@ jobs:
4242
id: pages
4343
uses: actions/configure-pages@v4
4444

45-
# for debugging
46-
- if: runner.debug == '1'
45+
- uses: jwalton/gh-find-current-pr@master
46+
if: github.event.action != 'closed'
47+
id: pr
48+
with:
49+
state: all
50+
51+
- name: SSH debug
52+
if: runner.debug == '1'
4753
uses: mxschmitt/action-tmate@v3
4854

4955
- name: Build preview version of site
5056
if: github.event.action != 'closed'
5157
run: |
52-
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ github.event.number }}"
58+
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ env.pr }}"
59+
env:
60+
pr: ${{ steps.pr.outputs.pr }}
5361

5462
- name: Commit preview to Pages branch
5563
uses: rossjrw/pr-preview-action@v1.4.7

.github/workflows/build-site.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
# for debugging
24-
- uses: crazy-max/ghaction-dump-context@v2
23+
- name: Debug dump
24+
uses: crazy-max/ghaction-dump-context@v2
2525

2626
- name: Checkout branch contents
2727
uses: actions/checkout@v4
@@ -36,8 +36,8 @@ jobs:
3636
id: pages
3737
uses: actions/configure-pages@v4
3838

39-
# for debugging
40-
- if: runner.debug == '1'
39+
- name: SSH debug
40+
if: runner.debug == '1'
4141
uses: mxschmitt/action-tmate@v3
4242

4343
- name: Set root url

.github/workflows/first-time-setup.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
# for debugging
17-
- uses: crazy-max/ghaction-dump-context@v2
16+
- name: Debug dump
17+
uses: crazy-max/ghaction-dump-context@v2
1818

1919
- name: Create Pages branch
2020
uses: peterjgrainger/action-create-branch@v3.0.0
@@ -28,8 +28,8 @@ jobs:
2828
with:
2929
ref: gh-pages
3030

31-
# for debugging
32-
- if: runner.debug == '1'
31+
- name: SSH debug
32+
if: runner.debug == '1'
3333
uses: mxschmitt/action-tmate@v3
3434

3535
# clean slate, as if starting from orphan branch
@@ -70,8 +70,8 @@ jobs:
7070
run: |
7171
user="${{ github.repository_owner }}"
7272
description="An engaging 1-3 sentence description of your lab."
73-
printf "USER=${user}" >> $GITHUB_ENV
74-
printf "DESCRIPTION=${description}" >> $GITHUB_ENV
73+
printf "\nUSER=${user}" >> $GITHUB_ENV
74+
printf "\nDESCRIPTION=${description}" >> $GITHUB_ENV
7575
7676
- name: Personalize readme for user
7777
run: |
File renamed without changes.
File renamed without changes.

.github/workflows/on-schedule.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,3 @@ jobs:
2020
uses: ./.github/workflows/update-citations.yaml
2121
with:
2222
open-pr: true
23-
24-
build-preview:
25-
needs: update-citations
26-
if: needs.update-citations.outputs.changed == 'true'
27-
uses: ./.github/workflows/build-preview.yaml

.github/workflows/update-citations.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,40 @@ jobs:
2828
timeout-minutes: 15
2929

3030
steps:
31-
# for debugging
32-
- uses: crazy-max/ghaction-dump-context@v2
31+
- name: Debug dump
32+
uses: crazy-max/ghaction-dump-context@v2
3333

3434
- name: Checkout branch contents
35+
if: github.event.action != 'closed'
3536
uses: actions/checkout@v4
3637
with:
3738
repository: ${{ github.event.pull_request.head.repo.full_name }}
3839
ref: ${{ github.head_ref }}
3940

4041
- name: Setup Python
42+
if: github.event.action != 'closed'
4143
uses: actions/setup-python@v5
4244
with:
4345
python-version: "3.11"
4446
cache: "pip"
4547
cache-dependency-path: "**/requirements.txt"
4648

4749
- name: Install Python packages
50+
if: github.event.action != 'closed'
4851
run: |
4952
python -m pip install --upgrade --requirement ./_cite/requirements.txt
5053
51-
# for debugging
52-
- if: runner.debug == '1'
54+
- name: SSH debug
55+
if: runner.debug == '1'
5356
uses: mxschmitt/action-tmate@v3
5457

5558
- name: Build updated citations
59+
if: github.event.action != 'closed'
5660
run: python _cite/cite.py
5761
timeout-minutes: 15
5862

5963
- name: Check if citations changed
64+
if: github.event.action != 'closed'
6065
id: changed
6166
uses: tj-actions/verify-changed-files@v18
6267
with:
@@ -65,6 +70,7 @@ jobs:
6570
6671
- name: Commit updated citations to branch
6772
if: |
73+
github.event.action != 'closed' &&
6874
steps.changed.outputs.files_changed == 'true' &&
6975
inputs.open-pr != true
7076
uses: stefanzweifel/git-auto-commit-action@v5
@@ -73,12 +79,15 @@ jobs:
7379

7480
- name: Open pull request with updated citations
7581
if: |
82+
github.event.action != 'closed' &&
7683
steps.changed.outputs.files_changed == 'true' &&
7784
inputs.open-pr == true
7885
uses: peter-evans/create-pull-request@v6
7986
with:
8087
branch: citation-update
8188
title: Periodic citation update
89+
body: |
90+
To see a live preview of this PR, close (don't merge) and reopen it.
8291
8392
outputs:
84-
changed: ${{ steps.changed.outputs.files_changed }}
93+
changed: ${{ steps.changed.outputs.files_changed || false }}

.github/workflows/update-url.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
# for debugging
23-
- uses: crazy-max/ghaction-dump-context@v2
22+
- name: Debug dump
23+
uses: crazy-max/ghaction-dump-context@v2
2424

2525
- name: Get Pages url
2626
id: pages
@@ -29,8 +29,8 @@ jobs:
2929
- name: Checkout branch contents
3030
uses: actions/checkout@v4
3131

32-
# for debugging
33-
- if: runner.debug == '1'
32+
- name: SSH debug
33+
if: runner.debug == '1'
3434
uses: mxschmitt/action-tmate@v3
3535

3636
# update link to site in readme

.github/workflows/versioning.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
github.event_name == 'pull_request'
2121
runs-on: ubuntu-latest
2222
steps:
23-
# for debugging
24-
- uses: crazy-max/ghaction-dump-context@v2
23+
- name: Debug dump
24+
uses: crazy-max/ghaction-dump-context@v2
2525
- if: runner.debug == '1'
2626
uses: mxschmitt/action-tmate@v3
2727

@@ -85,17 +85,17 @@ jobs:
8585
github.event_name == 'push'
8686
runs-on: ubuntu-latest
8787
steps:
88-
# for debugging
89-
- uses: crazy-max/ghaction-dump-context@v2
88+
- name: Debug dump
89+
uses: crazy-max/ghaction-dump-context@v2
9090

9191
- name: Checkout branch contents
9292
uses: actions/checkout@v4
9393

9494
- name: Install packages
9595
run: npm install yaml semver
9696

97-
# for debugging
98-
- if: runner.debug == '1'
97+
- name: SSH debug
98+
if: runner.debug == '1'
9999
uses: mxschmitt/action-tmate@v3
100100

101101
- name: Get version and body

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
Reference: common-changelog.org
44

5+
## 1.3.0 - 2024-08-16
6+
7+
### Changed
8+
9+
- List component `filters` parameter changed to `filter` and now takes any Ruby expression instead of the existing custom syntax.
10+
Example: `filters="publisher: bioRxiv, date: ^2020"` becomes `filter="publisher == 'bioRxiv' and date =~ /^2020/"`.
11+
See docs for more info.
12+
- Fix rare bug where data (e.g. a paper title) containing certain characters (e.g. a double quote) can mess up HTML rendering.
13+
- Fix "first time setup" workflow bug.
14+
- Tweak GitHub Actions debugging/logging.
15+
16+
### Added
17+
18+
- Styling for `<details>` HTML element.
19+
520
## 1.2.2 - 2024-06-05
621

722
### Added
@@ -37,7 +52,7 @@ Reference: common-changelog.org
3752

3853
- Add `image` param to support blog post thumbnails.
3954
- Add `html-proofer` plugin that checks for broken images/links/etc.
40-
- Add `remove` flag to remove a source from a metasource.
55+
- Add `remove` flag to remove a source from a metasource.
4156

4257
## 1.1.6 - 2023-10-06
4358

0 commit comments

Comments
 (0)