Skip to content

chore(ci): harden supply-chain workflows#134

Merged
Palbahngmiyine merged 1 commit intosolapi:masterfrom
Palbahngmiyine:codex/supply-chain-master
Apr 15, 2026
Merged

chore(ci): harden supply-chain workflows#134
Palbahngmiyine merged 1 commit intosolapi:masterfrom
Palbahngmiyine:codex/supply-chain-master

Conversation

@Palbahngmiyine
Copy link
Copy Markdown
Member

Summary

  • replace the release workflow chain with a CI gate that preserves the current release-please flow on trusted branches
  • pin GitHub Actions by full SHA, add workflow security checks, and add Dependabot updates for npm and GitHub Actions
  • prepare release workflows for a protected release environment and trusted publishing fallback

Verification

  • pnpm lint:ci
  • pnpm test:ci
  • YAML parsing for all workflow files
  • bash -n .github/scripts/wait-for-workflow.sh
  • validated wait-for-workflow.sh against recent upstream master and beta CI runs

@Palbahngmiyine Palbahngmiyine merged commit ca32d79 into solapi:master Apr 15, 2026
8 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a Dependabot configuration for npm and GitHub Actions, alongside a new bash script, wait-for-workflow.sh, designed to poll and wait for specific GitHub workflow runs. Feedback focused on optimizing the bash script for performance, specifically suggesting a C-style for loop instead of seq and consolidating multiple jq calls into a single execution to reduce process overhead.


echo "Waiting for ${workflow_file} on ${branch_name}@${commit_sha}"

for attempt in $(seq 1 "${max_attempts}"); do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using $(seq ...) in a for loop can be inefficient as it generates all numbers at once in memory and involves a command substitution. For better performance and to follow shell scripting best practices, it's preferable to use a C-style for loop, which avoids creating a sub-process.

Suggested change
for attempt in $(seq 1 "${max_attempts}"); do
for (( attempt = 1; attempt <= max_attempts; attempt++ )); do

Comment on lines +31 to +33
run_id="$(jq -r '.databaseId' <<<"${run_json}")"
run_status="$(jq -r '.status' <<<"${run_json}")"
run_conclusion="$(jq -r '.conclusion // empty' <<<"${run_json}")"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Calling jq multiple times to parse the same JSON object is inefficient due to the overhead of starting a new process for each call. You can achieve the same result more efficiently by using a single jq command to extract all necessary values at once.

Suggested change
run_id="$(jq -r '.databaseId' <<<"${run_json}")"
run_status="$(jq -r '.status' <<<"${run_json}")"
run_conclusion="$(jq -r '.conclusion // empty' <<<"${run_json}")"
{
read -r run_id
read -r run_status
read -r run_conclusion
} < <(jq -r '.databaseId, .status, .conclusion // empty' <<<"${run_json}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant