-
-
Notifications
You must be signed in to change notification settings - Fork 445
Add publish to Chocolatey dispatch action #3554
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
Conversation
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.
Pull Request Overview
Adds a consolidated workflow that dispatches release jobs for both the website and Chocolatey package.
- Removes the standalone
website_deploy.yml
in favor of a unifiedrelease_deploy.yml
- Introduces a new
publish-chocolatey
job to trigger the Chocolatey package dispatch - Retains the
deploy-website
job for website deployment on releases
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
.github/workflows/website_deploy.yml | Removed legacy dispatch workflow for website deploy |
.github/workflows/release_deploy.yml | Added combined release workflow with website and Chocolatey dispatch jobs |
Comments suppressed due to low confidence (1)
.github/workflows/release_deploy.yml:31
- [nitpick] The secret name
Publish_Chocolatey
is inconsistent withDEPLOY_FLOW_WEBSITE
. Consider renaming toPUBLISH_CHOCOLATEY
for consistency.
-H "Authorization: Bearer ${{ secrets.Publish_Chocolatey }}"
🥷 Code experts: no user matched threshold 10 See detailsTo learn more about /:\ gitStream - Visit our Docs |
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
This comment has been minimized.
This comment has been minimized.
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
📝 WalkthroughWalkthroughA new GitHub Actions workflow file was introduced to handle release deployments, including both website and Chocolatey package publishing. The previous website deployment workflow was removed. The new workflow triggers on release publication or manual invocation and coordinates dispatch events to external repositories for deployment and publishing tasks. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant WebsiteRepo
participant ChocolateyRepo
GitHubActions->>GitHubActions: Trigger on release or manual dispatch
GitHubActions->>WebsiteRepo: POST repository_dispatch (event: deploy)
WebsiteRepo-->>GitHubActions: HTTP 204 (success)
GitHubActions->>ChocolateyRepo: POST repository_dispatch (event: publish)
ChocolateyRepo-->>GitHubActions: HTTP 204 (success)
Suggested labels
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (7)
.github/workflows/release_deploy.yml (7)
1-1
: Ensure consistent Unix line endings.
The YAML file contains incorrect new line characters as reported by YAMLlint. Converting to LF (\n
) line endings will prevent parsing issues on Linux runners.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 1-1: wrong new line character: expected \n
(new-lines)
22-22
: Remove trailing whitespace.
Line 22 contains trailing spaces; removing them will satisfy YAMLlint and improve readability.🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 22-22: trailing spaces
(trailing-spaces)
15-15
: Remove-f
flag for consistent error handling.
The-f
(fail) option causescurl
to exit immediately on 4xx/5xx errors, bypassing your custom error message logic. Removing-f
ensures that all HTTP status codes are captured inhttp_status
and handled uniformly.-http_status=$(curl -L -f -s -o /dev/null -w "%{http_code}" \ +http_status=$(curl -L -s -o /dev/null -w "%{http_code}" \
17-17
: Add Content-Type header to API request.
Include-H "Content-Type: application/json"
after theAccept
header to explicitly declare the request body format. This aligns with GitHub API best practices.- -H "Accept: application/vnd.github+json" \ + -H "Accept: application/vnd.github+json" \ + -H "Content-Type: application/json" \
30-30
: Add Content-Type header to Chocolatey dispatch.
Similarly, add-H "Content-Type: application/json"
in thepublish-chocolatey
job for consistency.- -H "Accept: application/vnd.github+json" \ + -H "Accept: application/vnd.github+json" \ + -H "Content-Type: application/json" \
18-18
: Standardize secret naming conventions.
You reference secrets asDEPLOY_FLOW_WEBSITE
andPublish_Chocolatey
. For consistency and to follow GitHub community conventions, consider renamingPublish_Chocolatey
toPUBLISH_CHOCOLATEY
(or adjust both to the same style).Also applies to: 31-31
10-35
: DRY the workflow with a job matrix.
The two dispatch jobs differ only by repository, event type, and secret. Refactoring to use a matrix will reduce duplication and simplify maintenance:jobs: dispatch: strategy: matrix: target: - { repo: flow-launcher.github.io, event: deploy, secret: DEPLOY_FLOW_WEBSITE } - { repo: chocolatey-package, event: publish, secret: PUBLISH_CHOCOLATEY } runs-on: ubuntu-latest steps: - name: Trigger ${{ matrix.event }} for ${{ matrix.repo }} run: | http_status=$(curl -L -s -o /dev/null -w "%{http_code}" \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${{ secrets[matrix.secret] }}" \ https://api.github.com/repos/Flow-Launcher/${{ matrix.repo }}/dispatches \ -d '{"event_type":"${{ matrix.event }}"}') if [ "$http_status" -ne 204 ]; then echo "Error: ${{ matrix.event }} dispatch to ${{ matrix.repo }} failed with code $http_status"; exit 1; fiThis approach enhances readability and makes it easier to add more dispatch targets in the future.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 22-22: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/release_deploy.yml
(1 hunks).github/workflows/website_deploy.yml
(0 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/website_deploy.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/release_deploy.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
[error] 22-22: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
🔇 Additional comments (2)
.github/workflows/release_deploy.yml (2)
3-7
: Workflow trigger configuration looks good.
The workflow is set to run onrelease.published
and manual dispatch, which aligns with the PR objective to automate new release deployments.
18-19
: Verify repository secrets and permissions.
Confirm thatDEPLOY_FLOW_WEBSITE
andPUBLISH_CHOCOLATEY
(or your chosen variants) exist in the repo settings and that these tokens have the proper scopes (e.g.,repo
orworkflow
) to dispatch events on the target repositories.Also applies to: 31-33
Add a new step to use dispatch event to call the Chocolatey package repo to update and publish on new releases.