-
Notifications
You must be signed in to change notification settings - Fork 52
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
String with colon is loaded as object #118
Comments
You get the error when the label no longer exists on the issue. Try running the Does the action work the first time? My guess is that the action is run again after the label was removed. You can add an If it fails the first time, can you create a minimal public repository to replicate the problem? I'll have a look |
I get the error even if the label still exists. I created a minimal public repository: robingenz/octokit-request-action-issues-118.
The label is still present. |
thanks!
that very much sounds like a YAML problem 😌 You see how it says It's likely related to how we load the YAML config here: Line 66 in 8609a6a
Here is a test case to confirm my assumption https://runkit.com/gr2m/octokit-request-action-118 I'm open to ideas how to fix it. The reason why we do load value this way is that some parameters need to be set to objects, that's why we have the complex example in the readme with this line: output: | # The | is significant! I think you can probably workaround the problem you are having by doing the following - label: 'needs: reply'
+ label: |
+ |
+ needs: label Can you give that a try? Ideally we would support the |
maybe there is some YAML escape syntax that we can recommend to use for cases such as yours? I'm not super familiar with YAML though, not sure what the correct one would be, I always get lost in the YAML spec |
Thank you for pointing this out. - label: 'needs: reply'
+ label: |
+ |
+ needs: label Unfortunately, this did not work (workflow run / comment). I also tried: label: >
needs: reply
label: >-
needs: reply
label: "
needs: reply"
label: |-
needs: reply I couldn't find any YAML escape syntax so far. I will look for other possible solutions over the weekend. |
Hmm at least the workflow run output looks correct: Can you please enable DEBUG logs by adding the |
It seems that the string now is
With a line break at the end. Can you try this please? label: |
|-
needs: reply Gosh this syntax makes me cringe 🤣 |
I enabled the debug logs. However, the line break did not move. 😄 |
At least now I'm positive that there is a line break at the end: |
My temporary workaround: name: Remove needs-reply label
on:
issue_comment:
types:
- created
jobs:
needs-reply:
runs-on: ubuntu-latest
steps:
- name: Remove needs-reply label
run: |
curl --request DELETE \
--url 'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels/needs%3A%20reply' \
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' Just in case anyone else is looking for a quick fix. |
Short update: Unfortunately, I have not found a syntax that works. As soon as I have some more time I will try to find a fix for the action. Until then, I'll use my workaround. |
I have fixed a similar issue by adding an extra Before: For context see: https://github.com/dodona-edu/dodona/pull/4808 |
First of all, thanks for this helpful GitHub action!
I want to use this action to delete a specific label whenever a comment is created on an issue.
The label is:
needs: reply
.This is my workflow:
I get the following error when running the action:
(see this example)
The following request works:
For this reason, I assume that the error lies with the action.
Please let me know if you need more information.
Thank you very much!
The text was updated successfully, but these errors were encountered: