Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ jobs:
if: '!cancelled()'
name: Documentation
runs-on: ubuntu-latest
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/docs-preview-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ jobs:
cleanup:
name: Cleanup documentation preview
runs-on: ubuntu-latest
concurrency:
group: gh-pages-deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
with:
Expand Down
23 changes: 20 additions & 3 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ on:
- master

permissions:
actions: read
issues: write
pull-requests: write

jobs:
comment:
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
if: github.event.workflow_run.event == 'pull_request'
name: Comment documentation preview URL
runs-on: ubuntu-latest
steps:
Expand All @@ -44,6 +43,24 @@ jobs:
return;
}

if (data.head.sha !== context.payload.workflow_run.head_sha) {
core.info('Workflow run is not for the current pull request head.');
return;
}

const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, {
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
per_page: 100,
});

const docsJob = jobs.find(job => job.name === 'Documentation');
if (docsJob?.conclusion !== 'success') {
core.info(`Documentation job conclusion: ${docsJob?.conclusion ?? 'missing'}.`);
return;
}

core.setOutput('number', pr.number);

- name: Comment preview URL
Expand Down
Loading