Skip to content

Commit 88bb802

Browse files
authored
Merge pull request #220 from steve-downey/main
Merge upstream
2 parents fd084b6 + ab2aee0 commit 88bb802

8 files changed

Lines changed: 106 additions & 14 deletions

File tree

.github/workflows/ci_tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ on:
1616

1717
jobs:
1818
beman-submodule-check:
19-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@503ac65da3fd803044bc82b2fe748b2fc6f503cd # 1.5.3
19+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@4d946e210ce2ee68ccd8607c8acccacf171830c5 # 1.7.1
2020

2121
preset-test:
22-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@503ac65da3fd803044bc82b2fe748b2fc6f503cd # 1.5.3
22+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@4d946e210ce2ee68ccd8607c8acccacf171830c5 # 1.7.1
2323
with:
2424
matrix_config: >
2525
[
@@ -34,7 +34,7 @@ jobs:
3434
]
3535
3636
build-and-test:
37-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@503ac65da3fd803044bc82b2fe748b2fc6f503cd # 1.5.3
37+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@4d946e210ce2ee68ccd8607c8acccacf171830c5 # 1.7.1
3838
with:
3939
matrix_config: >
4040
{
@@ -147,4 +147,4 @@ jobs:
147147
permissions:
148148
contents: read
149149
issues: write
150-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@503ac65da3fd803044bc82b2fe748b2fc6f503cd # 1.5.3
150+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@4d946e210ce2ee68ccd8607c8acccacf171830c5 # 1.7.1

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
6060
steps:
6161
- name: Harden the runner (Audit all outbound calls)
62-
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
62+
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
6363
with:
6464
egress-policy: audit
6565

@@ -77,7 +77,7 @@ jobs:
7777

7878
# Initializes the CodeQL tools for scanning.
7979
- name: Initialize CodeQL
80-
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
80+
uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
8181
with:
8282
languages: ${{ matrix.language }}
8383
build-mode: ${{ matrix.build-mode }}
@@ -106,7 +106,7 @@ jobs:
106106
107107
exit 1
108108
- name: Perform CodeQL Analysis
109-
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
109+
uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
110110
with:
111111

112112
category: "/language:${{matrix.language}}"

.github/workflows/docs-comment.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+
3+
# Posts a PR preview comment after the Documentation workflow completes.
4+
#
5+
# This is intentionally a separate workflow from docs.yml. The
6+
# `pull_request` event (used in docs.yml) always runs with a read-only
7+
# GITHUB_TOKEN for fork PRs, so it cannot post comments. The
8+
# `workflow_run` event runs code from the BASE branch — never from the
9+
# fork — and is granted write permissions safely. No fork code executes
10+
# here; we only read trusted metadata from the workflow_run context.
11+
#
12+
# Reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_run
13+
14+
name: Documentation Preview Comment
15+
16+
on:
17+
workflow_run:
18+
workflows: ["Documentation"]
19+
types: [completed]
20+
21+
permissions:
22+
pull-requests: write
23+
24+
jobs:
25+
comment:
26+
name: Post preview link
27+
runs-on: ubuntu-latest
28+
# Only comment on PR builds that succeeded. Push and
29+
# workflow_dispatch builds don't have a PR to comment on.
30+
if: >
31+
github.event.workflow_run.event == 'pull_request' &&
32+
github.event.workflow_run.conclusion == 'success'
33+
34+
steps:
35+
- name: Harden the runner (Audit all outbound calls)
36+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
37+
with:
38+
egress-policy: audit
39+
40+
- name: Post or update PR preview comment
41+
uses: actions/github-script@v7
42+
with:
43+
script: |
44+
const MARKER = '<!-- docs-preview-comment -->'
45+
const run = context.payload.workflow_run
46+
const runUrl = run.html_url
47+
const sha = run.head_sha.slice(0, 7)
48+
const body = [
49+
MARKER,
50+
`📚 **Documentation preview** for \`${sha}\` — [workflow run](${runUrl})`,
51+
'',
52+
'To review: open the **docs-site** artifact from that run,',
53+
'extract the zip, and open `index.html` in a browser.',
54+
].join('\n')
55+
56+
// Locate the open PR that matches this workflow run's head
57+
// branch. For same-repo PRs github.event.pull_request is
58+
// available directly; for fork PRs we search by head label.
59+
const headLabel = `${run.head_repository.owner.login}:${run.head_branch}`
60+
const { data: prs } = await github.rest.pulls.list({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
head: headLabel,
64+
state: 'open',
65+
})
66+
if (prs.length === 0) {
67+
core.info(`No open PR found for head ${headLabel}; skipping comment.`)
68+
return
69+
}
70+
const issue_number = prs[0].number
71+
72+
const { data: comments } = await github.rest.issues.listComments({
73+
owner: context.repo.owner,
74+
repo: context.repo.repo,
75+
issue_number,
76+
})
77+
const existing = comments.find(c => c.body.includes(MARKER))
78+
if (existing) {
79+
await github.rest.issues.updateComment({
80+
owner: context.repo.owner,
81+
repo: context.repo.repo,
82+
comment_id: existing.id,
83+
body,
84+
})
85+
} else {
86+
await github.rest.issues.createComment({
87+
owner: context.repo.owner,
88+
repo: context.repo.repo,
89+
issue_number,
90+
body,
91+
})
92+
}

.github/workflows/doxygen-gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
contents: write
1717
steps:
1818
- name: Harden the runner (Audit all outbound calls)
19-
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
19+
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
2020
with:
2121
egress-policy: audit
2222

.github/workflows/ossf-scorecard-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Harden the runner (Audit all outbound calls)
25-
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
25+
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
2626
with:
2727
egress-policy: audit
2828

@@ -56,6 +56,6 @@ jobs:
5656
# Upload the results to GitHub's code scanning dashboard (optional).
5757
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
5858
- name: "Upload to code-scanning"
59-
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
59+
uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
6060
with:
6161
sarif_file: results.sarif

.github/workflows/pre-commit-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
checks: write
1616
issues: write
1717
pull-requests: write
18-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@503ac65da3fd803044bc82b2fe748b2fc6f503cd # ratchet:bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.5.3
18+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@4d946e210ce2ee68ccd8607c8acccacf171830c5 # ratchet:bemanproject/infra-workflows/.github/workflows/reusable-beman-pre-commit.yml@1.7.1

.github/workflows/pre-commit-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
contents: write
1717
pull-requests: write
18-
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@503ac65da3fd803044bc82b2fe748b2fc6f503cd # 1.5.3
18+
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-update-pre-commit.yml@4d946e210ce2ee68ccd8607c8acccacf171830c5 # 1.7.1
1919
secrets:
2020
APP_ID: ${{ secrets.AUTO_PR_BOT_APP_ID }}
2121
PRIVATE_KEY: ${{ secrets.AUTO_PR_BOT_PRIVATE_KEY }}

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Harden the runner (Audit all outbound calls)
22-
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
22+
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
2323
with:
2424
egress-policy: audit
2525

@@ -50,7 +50,7 @@ jobs:
5050

5151
steps:
5252
- name: Harden the runner (Audit all outbound calls)
53-
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
53+
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
5454
with:
5555
egress-policy: audit
5656

0 commit comments

Comments
 (0)