-
Notifications
You must be signed in to change notification settings - Fork 42
ci: restrict image publish/deploy to canonical repo and main branch #329
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
Changes from all commits
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ env: | |||||||||
| jobs: | ||||||||||
| publish-image: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||||||
|
Contributor
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 Gate is correct; add branch constraints for release/dispatch. - if: github.repository == 'exospherehost/exospherehost'
+ if: github.repository == 'exospherehost/exospherehost' &&
+ (github.event_name != 'release' || github.event.release.target_commitish == 'main') &&
+ (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main')📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| permissions: | ||||||||||
| contents: read | ||||||||||
|
|
@@ -58,6 +59,7 @@ jobs: | |||||||||
| deploy-to-k8s: | ||||||||||
| needs: publish-image | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||||||
|
Contributor
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 Mirror the same guard on deploy job. - if: github.repository == 'exospherehost/exospherehost'
+ if: github.repository == 'exospherehost/exospherehost' &&
+ (github.event_name != 'release' || github.event.release.target_commitish == 'main') &&
+ (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main')🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| steps: | ||||||||||
| - name: Deploy to K8s | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ env: | |||||
| jobs: | ||||||
| publish-image: | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||
|
Contributor
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. 🧹 Nitpick (assertive) Repo gate looks right; prefer explicit expression syntax for consistency. Functionally OK; this is a style/readability nit that aligns with Actions examples. - if: github.repository == 'exospherehost/exospherehost'
+ if: ${{ github.repository == 'exospherehost/exospherehost' }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,6 +17,7 @@ env: | |||||
| jobs: | ||||||
| publish-image: | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||
|
Contributor
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. 🧹 Nitpick (assertive) Good repo gate; wrap in expression syntax and (optionally) guard manual runs to main. Using explicit expression syntax improves readability and parity with docs. Since this workflow supports workflow_dispatch, consider ensuring manual runs happen only on main. Apply: - if: github.repository == 'exospherehost/exospherehost'
+ if: ${{ github.repository == 'exospherehost/exospherehost' && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main') }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
@@ -59,6 +60,7 @@ jobs: | |||||
| deploy-to-k8s: | ||||||
| needs: publish-image | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||
|
Contributor
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. 🧹 Nitpick (assertive) Mirror the same gating refinement on deploy job. Keep repo guard and add a main-branch check for manual runs; also use explicit expression syntax. - if: github.repository == 'exospherehost/exospherehost'
+ if: ${{ github.repository == 'exospherehost/exospherehost' && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main') }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| steps: | ||||||
| - name: Deploy to K8s | ||||||
| run: | | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,7 @@ jobs: | |
| defaults: | ||
| run: | ||
| working-directory: python-sdk | ||
| if: github.repository == 'exospherehost/exospherehost' | ||
|
Contributor
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. 🧹 Nitpick (assertive) Use explicit expression syntax for the repo gate. Keeps conditions uniform across workflows. - if: github.repository == 'exospherehost/exospherehost'
+ if: ${{ github.repository == 'exospherehost/exospherehost' }}🤖 Prompt for AI Agents |
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -74,6 +74,7 @@ jobs: | |||||||||
| publish-image: | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| needs: test | ||||||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||||||
|
Contributor
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 Gate is good; add branch constraints for release/dispatch. - if: github.repository == 'exospherehost/exospherehost'
+ if: github.repository == 'exospherehost/exospherehost' &&
+ (github.event_name != 'release' || github.event.release.target_commitish == 'main') &&
+ (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main')📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| permissions: | ||||||||||
| contents: read | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ env: | |||||
| jobs: | ||||||
| publish-image: | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||
|
Contributor
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 Repo gate approved; also limit to main-targeted releases. - if: github.repository == 'exospherehost/exospherehost'
+ if: github.repository == 'exospherehost/exospherehost' && github.event.release.target_commitish == 'main'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -62,6 +62,7 @@ jobs: | |||||
| defaults: | ||||||
| run: | ||||||
| working-directory: python-sdk | ||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||
|
Contributor
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 Good guard; add main-branch constraint for releases. Ensure releases publish only when the tag targets main. - if: github.repository == 'exospherehost/exospherehost'
+ if: github.repository == 'exospherehost/exospherehost' && github.event.release.target_commitish == 'main'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,6 +67,7 @@ jobs: | |||||
| publish-image: | ||||||
| runs-on: ubuntu-latest | ||||||
| needs: test | ||||||
| if: github.repository == 'exospherehost/exospherehost' | ||||||
|
Contributor
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 Repo gate looks right; also require releases from main. - if: github.repository == 'exospherehost/exospherehost'
+ if: github.repository == 'exospherehost/exospherehost' && github.event.release.target_commitish == 'main'📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
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.
🛠️ Refactor suggestion
Restrict workflow_dispatch runs to main as well.
This workflow is dispatch-only; add a ref guard to avoid accidental non-main deploys, and use explicit expression syntax.
📝 Committable suggestion
🤖 Prompt for AI Agents