Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
28 changes: 14 additions & 14 deletions .github/REUSABLE_WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
fix-cmake:
uses: Framework-R-D/phlex/.github/workflows/cmake-format-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true" # Set to true when calling from a parent workflow
secrets:
Expand All @@ -172,7 +172,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to check out.
- `ref` (string, **required**): The branch name to check out and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to check out from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments (use when called from a parent workflow that will post a combined comment).

Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
fix-python:
uses: Framework-R-D/phlex/.github/workflows/python-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true"
secrets:
Expand All @@ -233,7 +233,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to check out.
- `ref` (string, **required**): The branch name to check out and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to check out from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments.

Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
fix-markdown:
uses: Framework-R-D/phlex/.github/workflows/markdown-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true"
secrets:
Expand All @@ -294,7 +294,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to check out.
- `ref` (string, **required**): The branch name to check out and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to check out from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments.

Expand Down Expand Up @@ -369,7 +369,7 @@ jobs:
fix-jsonnet:
uses: Framework-R-D/phlex/.github/workflows/jsonnet-format-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true"
secrets:
Expand All @@ -379,7 +379,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to checkout.
- `ref` (string, **required**): The branch name to checkout and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to checkout from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments.

Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
fix-clang-format:
uses: Framework-R-D/phlex/.github/workflows/clang-format-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true"
secrets:
Expand All @@ -458,7 +458,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to check out.
- `ref` (string, **required**): The branch name to check out and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to check out from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments.

Expand Down Expand Up @@ -488,7 +488,7 @@ jobs:
fix-header-guards:
uses: Framework-R-D/phlex/.github/workflows/header-guards-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true"
secrets:
Expand All @@ -498,7 +498,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to check out.
- `ref` (string, **required**): The branch name to check out and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to check out from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments.

Expand Down Expand Up @@ -528,7 +528,7 @@ jobs:
fix-yaml:
uses: Framework-R-D/phlex/.github/workflows/yaml-fix.yaml@<commit_sha>
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: ${{ github.event.pull_request.head.ref }}
repo: ${{ github.repository }}
skip-comment: "true"
secrets:
Expand All @@ -538,7 +538,7 @@ jobs:
#### All Inputs

- `checkout-path` (string, optional): Path to check out code to.
- `ref` (string, **required**): The branch, ref, or SHA to check out.
- `ref` (string, **required**): The branch name to check out and push fixes to (must be a branch, not a commit SHA).
- `repo` (string, **required**): The repository to check out from.
- `skip-comment` (string, optional, default: `"false"`): Skip posting individual PR comments.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run-name: "${{ github.actor }} fixing C++ code format"
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake-format-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run-name: "${{ github.actor }} fixing CMake format"
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/format-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,24 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
await github.rest.reactions.deleteForIssueComment({
const { data: reactions } = await github.rest.reactions.listForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
reaction_id: (await github.rest.reactions.listForIssueComment({
comment_id: context.payload.comment.id
});
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The listForIssueComment call is not guarded. If the API call fails (permissions/transient errors), this step will throw and can fail combine-results, preventing the combined PR comment from being posted. Since reaction cleanup is best-effort, wrap the list+delete logic in a try/catch (or mark the step continue-on-error: true) so the workflow can continue even if reactions can’t be queried.

Copilot uses AI. Check for mistakes.

const eyesReaction = reactions.find(
(r) => r.content === 'eyes' && r.user && r.user.type === 'Bot'
);

if (eyesReaction && eyesReaction.id) {
await github.rest.reactions.deleteForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id
})).data.find(r => r.content === 'eyes' && r.user.type === 'Bot')?.id
}).catch(() => {});
comment_id: context.payload.comment.id,
reaction_id: eyesReaction.id
}).catch(() => {});
}

- name: Add completion reaction
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
Expand Down Expand Up @@ -143,7 +151,7 @@ jobs:
if [ "$pushed" == "true" ]; then
messages+=("✅ $name fixes pushed (commit $sha_short)")
elif [ -n "$patch_name" ]; then
messages+=("⚠️ $name fixes available as patch artifact \"$patch_name\". Download the artifact from this workflow run, then run: \`git apply $patch_name\` from the repository root.")
messages+=("⚠️ $name fixes available as a patch file (\`$patch_name\`) in the \"fix-patch\" artifact. Download the artifact from this workflow run, then run: \`git apply $patch_name\` from the repository root.")
fi
fi
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/header-guards-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ run-name: "${{ github.actor }} fixing header guards"
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jsonnet-format-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run-name: "${{ github.actor }} fixing Jsonnet format"
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ run-name: "${{ github.actor }} fixing Markdown format"
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run-name: "${{ github.actor }} fixing Python code"
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-fix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name: YAML Fix
required: false
type: string
ref:
description: "The branch, ref, or SHA to checkout"
description: "The branch name to checkout and push fixes to (must be a branch, not a commit SHA)"
required: true
type: string
repo:
Expand Down
Loading