GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Make `take` issue comment to use curl by ShaharNaveh · Pull Request #5937 · RustPython/RustPython Conversation
|
WalkthroughThe workflow for assigning an issue via a comment command in the GitHub Actions configuration was updated. The assignment step now uses a direct REST API call with Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant GitHub API
User->>GitHub Actions: Comment triggers workflow
GitHub Actions->>GitHub API: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees (assign issue)
GitHub API-->>GitHub Actions: Assignment result
Possibly related PRs
Suggested reviewers
Poem
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
Documentation and Community
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
.github/workflows/comment-commands.yml (1 hunks)Learnt from: ShaharNaveh
PR: RustPython/RustPython#5932
File: .github/workflows/comment-commands.yml:18-24
Timestamp: 2025-07-10T10:08:43.304Z
Learning: In GitHub Actions workflows for the RustPython project, the maintainer ShaharNaveh prefers to keep workflows simple and doesn't mind if steps fail when the desired state is already achieved (e.g., user already assigned to an issue). Avoid suggesting complex error handling for edge cases they don't consider problematic.
Learnt from: ShaharNaveh
PR: RustPython/RustPython#5932
File: .github/workflows/comment-commands.yml:18-24
Timestamp: 2025-07-10T10:08:43.304Z
Learning: In GitHub Actions workflows for the RustPython project, the maintainer ShaharNaveh prefers to keep workflows simple and doesn't mind if steps fail when the desired state is already achieved (e.g., user already assigned to an issue). Avoid suggesting complex error handling for edge cases they don't consider problematic.
21-21: could not parse as YAML: yaml: line 21: mapping values are not allowed in this context
(syntax-check)
[error] 21-21: syntax error: mapping values are not allowed here
(syntax)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| steps: | ||
| - run: gh issue edit "${{ env.ISSUE_NUMBER }}" --add-assignee "@${{ env.USER_LOGIN }}" | ||
| env: | ||
| ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
| USER_LOGIN: ${{ github.event.comment.user.login }} | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} | ||
| # Using REST API and not `gh issue edit`. https://github.com/cli/cli/issues/6235#issuecomment-1243487651 | ||
| - run: curl \ | ||
| -H "Authorization: token ${{ github.token }}" \ | ||
| -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' \ | ||
| https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Workflow fails to parse – convert the multi-line run script to a block scalar.
actionlint / yamllint correctly report a YAML syntax error because the multi-line curl command is written as a plain scalar; the embedded : in the header line is parsed as a new mapping key.
The job will never start.
- - run: curl \ - -H "Authorization: token ${{ github.token }}" \ - -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees + - run: | + curl -sS \ + -H "Authorization: token ${{ github.token }}" \ + -H "Content-Type: application/json" \ + -d "{\"assignees\": [\"${{ github.event.comment.user.login }}\"]}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees"
Block-scalar (|) formatting eliminates the syntax error and makes the script easier to read.
Adding -H "Content-Type: application/json" and quoting the URL are optional polish but keep the command self-contained.
21-21: could not parse as YAML: yaml: line 21: mapping values are not allowed in this context
(syntax-check)
[error] 21-21: syntax error: mapping values are not allowed here
(syntax)
In .github/workflows/comment-commands.yml around lines 18 to 23, the multi-line
curl command under the run step is written as a plain scalar causing YAML syntax
errors due to unescaped colons. Convert the multi-line run script to use a block
scalar (|) to properly format the command as a literal block. Optionally, add
the header "Content-Type: application/json" and quote the URL string to improve
clarity and completeness.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai can you open a PR with those changes?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@ShaharNaveh I'll plan the code changes to fix the YAML syntax error in the workflow file. Another agent will execute these changes and create the PR for you.
The changes will fix the YAML parsing error by using proper block scalar formatting, and I've included the Content-Type header and URL quoting for better clarity and completeness as suggested in my previous comment.
Learnt from: ShaharNaveh
PR: RustPython/RustPython#5932
File: .github/workflows/comment-commands.yml:18-24
Timestamp: 2025-07-10T10:08:43.304Z
Learning: In GitHub Actions workflows for the RustPython project, the maintainer ShaharNaveh prefers to keep workflows simple and doesn't mind if steps fail when the desired state is already achieved (e.g., user already assigned to an issue). Avoid suggesting complex error handling for edge cases they don't consider problematic.
⏳ Preparing changes...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
A summary of the changes CodeRabbit can apply:
- Fix the YAML syntax error in the GitHub Actions workflow by converting the multi-line curl command to block scalar format with proper indentation and escaping, ensuring correct parsing of the Authorization header.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai Create PR with these edits
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
CodeRabbit has failed to create the PR to execute your edits.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai get me a copyable edit
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are the copyable edits based on the planned changes:
@@ -17,7 +17,9 @@ steps: # Using REST API and not `gh issue edit`. https://github.com/cli/cli/issues/6235#issuecomment-1243487651 - - run: curl \ - -H "Authorization: token ${{ github.token }}" \ - -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' \ - https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees + - run: | + curl -sS \ + -H "Authorization: token ${{ github.token }}" \ + -H "Content-Type: application/json" \ + -d "{"assignees": ["${{ github.event.comment.user.login }}"]}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.