-
Notifications
You must be signed in to change notification settings - Fork 1
Wrorflows #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Wrorflows #5
Changes from 10 commits
ff6f0fa
92cac14
2dcb597
c46ba86
ac8655f
4d364bb
0066822
d4b87c1
a281bef
52aa02b
025f4e4
8b633e8
d68411c
ea3f08a
b7670c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,18 +1,41 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Rust-Build | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build Package CI | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||
| types: [opened, synchronize, reopened] | ||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||||||||||
| beta_release: | ||||||||||||||||||||||||||||||||||||||||||||||||
| description: Create beta release | ||||||||||||||||||||||||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && 'main' || github.ref_name }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||
| optimize_ci: | ||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||||||||||||||||||||||||||||
| skip: ${{ steps.check_skip.outputs.skip }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: withgraphite/graphite-ci-action@1.4.0 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 26 in .github/workflows/build.yml
|
||||||||||||||||||||||||||||||||||||||||||||||||
| id: check_skip | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| graphite_token: ${{ secrets.GRAPHITE_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 29 in .github/workflows/build.yml
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Harden optimize_ci: pin action, add least-privilege perms, handle forks/no secret, and default skip=false. Prevents supply-chain, missing-secret, and output issues that would block downstream jobs. optimize_ci:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: read
outputs:
- skip: ${{ steps.check_skip.outputs.skip }}
+ skip: ${{ steps.check_skip.outputs.skip || steps.defaults.outputs.skip }}
steps:
+ - name: Default skip=false
+ id: defaults
+ run: echo "skip=false" >> "$GITHUB_OUTPUT"
- - uses: withgraphite/graphite-ci-action@v0.0.9
+ - uses: withgraphite/graphite-ci-action@<PINNED_COMMIT_SHA>
+ if: ${{ secrets.GRAPHITE_TOKEN != '' }}
id: check_skip
with:
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}Follow-up: replace <PINNED_COMMIT_SHA> with the exact commit SHA you trust. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: Codacy Static Code Analysis[warning] 26-26: .github/workflows/build.yml#L26 [warning] 26-26: .github/workflows/build.yml#L26 [warning] 29-29: .github/workflows/build.yml#L29 |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+24
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainPin external action and wire permissions; also ensure optimize_ci output is actually used.
Would you like me to open a follow-up PR to pin all third‑party actions to SHAs and add a permissions block? optimize_ci:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: read
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- - uses: withgraphite/graphite-ci-action@main
+ - uses: withgraphite/graphite-ci-action@<PINNED_COMMIT_SHA>
id: check_skip
with:
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== SHOW: .github/workflows/build.yml (up to 400 lines) ==="
if [ -f ".github/workflows/build.yml" ]; then
sed -n '1,400p' .github/workflows/build.yml || true
else
echo "FILE NOT FOUND: .github/workflows/build.yml"
fi
echo
echo "=== SEARCH: occurrences of 'optimize_ci' in .github/workflows ==="
rg -n --hidden -S "optimize_ci" .github || true
echo
echo "=== SEARCH: occurrences of withgraphite action across repo ==="
rg -n --hidden -S "withgraphite/graphite-ci-action" || true
echo
echo "=== SEARCH: workflows referencing '@main' for actions under .github ==="
rg -n --hidden -S "@main" .github || true
echo
echo "=== SEARCH: any 'permissions:' blocks in .github workflows (with context) ==="
rg -n --hidden -S "permissions:" .github -C3 || true
echo
echo "=== SEARCH: references to optimize_ci outputs (needs.optimize_ci.outputs or check_skip.outputs.skip) across repo ==="
rg -n --hidden -S "needs\.optimize_ci\.outputs|check_skip\.outputs\.skip|steps\.check_skip\.outputs\.skip" || true
echo
echo "=== SEARCH: any uses of 'graphite_token' or GRAPHITE_TOKEN secret ==="
rg -n --hidden -S "GRAPHITE_TOKEN|graphite_token" || trueLength of output: 4220 Pin third‑party actions, add least‑privilege permissions, and wire optimize_ci output
File: .github/workflows/build.yml (optimize_ci block) optimize_ci:
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: read
outputs:
skip: ${{ steps.check_skip.outputs.skip }}
steps:
- - uses: withgraphite/graphite-ci-action@main
+ - uses: withgraphite/graphite-ci-action@<PINNED_COMMIT_SHA>
id: check_skip
with:
graphite_token: ${{ secrets.GRAPHITE_TOKEN }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| check: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Check | ||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [optimize_ci] | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ needs.optimize_ci.outputs.skip != 'true' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout sources | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -32,9 +55,11 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Test | ||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [optimize_ci] | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ needs.optimize_ci.outputs.skip != 'true' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout sources | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions-rs/toolchain@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -81,10 +106,9 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
| components: clippy | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run clippy | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions-rs/cargo@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| command: clippy | ||||||||||||||||||||||||||||||||||||||||||||||||
| args: --tests -- -D warnings --message-format=json &> clippy_report.json | ||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| cargo clippy --tests --message-format=json -- -D warnings > clippy_report.json | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup sonarqube | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: warchant/setup-sonar-scanner@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Pin Sonar scanner action to a commit SHA Another third-party action that should be immutable. - uses: warchant/setup-sonar-scanner@v3
+ uses: warchant/setup-sonar-scanner@<PINNED_COMMIT_SHA>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix outputs reference to undefined step (breaks evaluation).
steps.defaultsdoesn’t exist; actionlint flags it and GitHub will treat it as invalid. Default to 'false' directly.📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
24-24: property "defaults" is not defined in object type {check_skip: {conclusion: string; outcome: string; outputs: {string => string}}}
(expression)
🤖 Prompt for AI Agents