Skip to content

Commit eb01986

Browse files
authored
Merge branch 'main' into issues/8301
2 parents 2b46f7c + 10b4532 commit eb01986

File tree

838 files changed

+43789
-4960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

838 files changed

+43789
-4960
lines changed

.github/workflows/actions/release-info/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ inputs:
2727
required: true
2828

2929
runs:
30-
using: "node16"
30+
using: "node20"
3131
main: "index.js"

.github/workflows/preview.yml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ name: Deploy Preview
88

99
concurrency:
1010
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
11+
# Use github.event.issue.number on issue comments, so it's unique per comment
1112
# Use github.ref on other branches, so it's unique per branch
12-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}
13+
group: ${{ github.workflow }}-${{ (github.event.pull_request && format('PR-{0}', github.event.pull_request.number)) || ( github.event.issue && format('comment-{0}', github.event.issue.number) ) || github.ref }}
1314
cancel-in-progress: true
1415

1516
jobs:
@@ -23,10 +24,25 @@ jobs:
2324
echo "::error title=Manual action required for preview::PR from fork can't be deployed as preview to Netlify automatically. Use '/deploy-preview' command in comments to trigger the preview manually."
2425
shell: bash
2526

27+
role-of-commenter:
28+
if: github.event.issue.pull_request
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check if commenter is a member, owner or collaborator
32+
id: commenter-check
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: |
36+
commenter_role=$(gh api repos/$GITHUB_REPOSITORY/collaborators/${{ github.event.comment.user.login }}/permission --jq '.permission')
37+
echo "commenter_role=$commenter_role" >> "$GITHUB_OUTPUT"
38+
echo "author_association=${{ github.event.comment.author_association }}" >> "$GITHUB_OUTPUT"
39+
shell: bash
40+
2641
build-deploy-preview:
2742
# Deploy a preview only if
2843
# - the PR is not from a fork,
2944
# - requested by PR comment /deploy-preview, from a repo user or github action bot (user id 41898282)
45+
# FIXME: We need to change the way we filter because somehow some MEMBER in API are seen as CONTRIBUTOR in CI
3046
if: >
3147
(
3248
github.event_name == 'pull_request' &&
@@ -36,6 +52,7 @@ jobs:
3652
github.event.issue.pull_request &&
3753
(
3854
github.event.comment.user.id == '41898282' ||
55+
github.event.comment.user.login == 'gordonwoodhull' ||
3956
github.event.comment.author_association == 'MEMBER' ||
4057
github.event.comment.author_association == 'OWNER' ||
4158
github.event.comment.author_association == 'COLLABORATOR'
@@ -102,8 +119,72 @@ jobs:
102119
Deploy from GHA: ${{ github.event.pull_request.title || format('manual from PR {0}', github.event.issue.number) }}
103120
alias: deploy-preview-${{ github.event.pull_request.number || github.event.issue.number }}
104121
# these all default to 'true'
105-
enable-pull-request-comment: true
122+
enable-pull-request-comment: false
106123
enable-commit-comment: false
107124
enable-commit-status: true
108125
overwrites-pull-request-comment: false
109126
timeout-minutes: 1
127+
128+
- name: Get changed files
129+
id: changed-files
130+
uses: tj-actions/[email protected]
131+
with:
132+
files: |
133+
# don't consider modifications on file used for includes for now.
134+
docs/**/[^_]*.qmd
135+
docs/**/[^_]*.md
136+
docs/extensions/listings/*.yml
137+
json: true
138+
escape_json: false
139+
140+
- name: Create custom PR comment
141+
if: github.event.pull_request || github.event.issue.pull_request
142+
uses: actions/github-script@v7
143+
env:
144+
DEPLOY_URL: ${{ steps.netlify-deploy.outputs.deploy-url }}
145+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
146+
with:
147+
github-token: ${{ secrets.GITHUB_TOKEN }}
148+
script: |
149+
const prNumber = context.payload.pull_request?.number || context.payload.issue.number;
150+
const deployUrl = process.env.DEPLOY_URL;
151+
const changedFiles = JSON.parse(process.env.CHANGED_FILES);
152+
153+
let commentBody = `## 📝 Preview Deployment\n\n`;
154+
commentBody += `🔍 Full site preview: [${deployUrl}](${deployUrl})\n\n`;
155+
156+
if (changedFiles.length > 0) {
157+
commentBody += `### 🔄 Modified Documents\n\n`;
158+
changedFiles.forEach(file => {
159+
let fileUrlPath;
160+
161+
// Define a mapping for special files to their corresponding URLs
162+
const specialFileMapping = {
163+
'docs/extensions/listings/shortcodes-and-filters.yml': 'docs/extensions/index.html',
164+
'docs/extensions/listings/journal-articles.yml': 'docs/extensions/index.html',
165+
'docs/extensions/listings/custom-formats.yml': 'docs/extensions/index.html',
166+
'docs/extensions/listings/revealjs-formats.yml': 'docs/extensions/index.html',
167+
'docs/extensions/listings/revealjs.yml': 'docs/extensions/index.html'
168+
};
169+
170+
// Check if the file is in the special mapping
171+
if (specialFileMapping[file]) {
172+
fileUrlPath = specialFileMapping[file];
173+
} else if (file.endsWith('.qmd') || file.endsWith('.md')) {
174+
// Convert path to URL (removing file extension and adding appropriate path)
175+
fileUrlPath = file.replace(/\.(qmd|md)$/, '.html');
176+
}
177+
178+
if (fileUrlPath) {
179+
const fileUrl = `${deployUrl}/${fileUrlPath}`;
180+
commentBody += `- [${file}](${fileUrl})\n`;
181+
}
182+
});
183+
}
184+
185+
github.rest.issues.createComment({
186+
issue_number: prNumber,
187+
owner: context.repo.owner,
188+
repo: context.repo.repo,
189+
body: commentBody
190+
});

.github/workflows/publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818

1919
name: Quarto Publish
2020

21+
concurrency:
22+
group: ${{ format('{0} - {1} - {2}', github.workflow, github.ref, inputs.prerelease && 'prerelease' || 'main') }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
build-deploy:
2327
runs-on: ubuntu-latest
@@ -43,14 +47,16 @@ jobs:
4347
- name: Render
4448
uses: quarto-dev/quarto-actions/render@v2
4549
env:
46-
QUARTO_PROFILE: ${{ (inputs.prerelease == 'true' || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease')) && 'prerelease-docs' || '' }}
50+
QUARTO_PROFILE: ${{ (inputs.prerelease || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease')) && 'prerelease-docs' || '' }}
4751

4852
- name: Publish release website
4953
# Only do this step if
5054
# - workflow is called for release deploy, with inputs.prerelease being false. It should not trigger if inputs.prerelease is null.
5155
# and in GHA null == false is true. That is why we convert to string and compare.
5256
# - workflow is triggered by push event on main branch
53-
if: ${{ format('{0}', inputs.prerelease) == 'false' || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/main') }}
57+
# - workflow is triggered by workflow_dispatch event
58+
# (we need to protect also from workflow_dispatch inherited from workflow_call event - where inputs.prerelease is defined)
59+
if: ${{ format('{0}', inputs.prerelease) == 'false' || (!inputs.prerelease && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/main') }}
5460
uses: quarto-dev/quarto-actions/publish@v2
5561
with:
5662
target: netlify
@@ -62,7 +68,9 @@ jobs:
6268
# - workflow is called for release deploy with inputs.prerelease being true. It should not trigger if inputs.prerelease is null.
6369
# Though as in GHA null means false, no need to cast to string
6470
# - workflow is triggered by push event on main branch
65-
if: ${{ inputs.prerelease || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease') }}
71+
# - workflow is triggered by workflow_dispatch event
72+
# (we need to protect also from workflow_dispatch inherited from workflow_call event - where inputs.prerelease is defined)
73+
if: ${{ inputs.prerelease || (format('{0}', inputs.prerelease) != 'false' && contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease') }}
6674
id: netlify-deploy
6775
uses: nwtgck/actions-netlify@v3
6876
env:

.github/workflows/upload-algolia.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
gem 'algolia', '=2.3.4'
12
require 'json'
23
require 'algolia'
34
require 'open-uri'

.github/workflows/upload-index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
ruby-version: 3.0.2
1818
- name: Install Algolia API Dependencies
1919
run: |
20-
gem install algolia
20+
gem install algolia -v 2.3.4
2121
- name: Upload Index for release website
2222
run: |
2323
pwd

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
# Use pipenv to manage dependencies
1818
# so we don't want to track this file in git
1919
requirements.txt
20+
21+
**/*.quarto_ipynb

.well-known/atproto-did

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
did:plc:yvu4igag5eha3sbbbx7poz2p

DESCRIPTION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ Depends:
77
dygraphs,
88
fs,
99
ggplot2,
10+
gh,
11+
gt,
1012
htmltools,
1113
knitr,
1214
leaflet,
15+
magick,
1316
openintro,
1417
palmerpenguins,
1518
readr,

Pipfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ shiny = "*"
2626
plotly = "*"
2727
pathlib = "*"
2828
nbformat = "*"
29+
statsmodels = "*"
30+
plotnine = "*"
2931

3032
[dev-packages]
3133

0 commit comments

Comments
 (0)