Skip to content
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

[Bug]: Labels with emoji and space are not supported #461

Closed
1 task done
kdeldycke opened this issue Feb 24, 2024 · 8 comments · Fixed by #462
Closed
1 task done

[Bug]: Labels with emoji and space are not supported #461

kdeldycke opened this issue Feb 24, 2024 · 8 comments · Fixed by #462
Assignees
Labels
bug Something isn't working

Comments

@kdeldycke
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hi have a step that looks like this:

      - uses: AndreasAugustin/actions-template-sync@v1.6.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          source_repo_path: kdeldycke/awesome-template
          pr_title: "[sync] Template"
          pr_commit_msg: "[sync] Template"
          pr_labels: 📚 documentation

(source)

This fails because the label contains emoji.

Expected Behavior

I would like actions-template-sync to be able to label PRs it creates with labels containing emojis and spaces.

Current Behavior

With the YAML configured as above with emoji, the action ends up with this issue:

git init
::info::Missing env variable 'UPSTREAM_BRANCH' setting to remote default main
::info::current git hash: 50898d2f59a096aa29e64c1cdef9fd680bd0e113
Check new changes
Pull template
commit changes
cleanup older PRs
check for missing labels
  HTTP 422: Validation Failed (https://api.github.com/repos/kdeldycke/awesome-engineering-team-management/labels)
  name must contain more than native emoji

Steps To Reproduce

No response

Possible Solution

No response

Additional Information/Context

No response

Template sync version Version

1.6.0

@kdeldycke kdeldycke added the bug Something isn't working label Feb 24, 2024
kdeldycke added a commit to kdeldycke/workflows that referenced this issue Feb 24, 2024
@kdeldycke
Copy link
Contributor Author

I tried hacking around the issue using quotes, replacing:

          pr_labels: 📚 documentation

with:

          pr_labels: '📚 documentation'

But it still fails:

check for missing labels
  HTTP 422: Validation Failed (https://api.github.com/repos/kdeldycke/awesome-billing/labels)
  name must contain more than native emoji

kdeldycke added a commit to kdeldycke/workflows that referenced this issue Feb 24, 2024
@kdeldycke
Copy link
Contributor Author

Double quoting doesn't work either:

          pr_labels: "📚 documentation"
check for missing labels
  HTTP 422: Validation Failed (https://api.github.com/repos/kdeldycke/awesome-falsehood/labels)
  name must contain more than native emoji

@AndreasAugustin
Copy link
Owner

AndreasAugustin commented Feb 25, 2024

Hi @kdeldycke and thank you for the bug report.
I can confirm the issue.

Following lines are responsible (Currently I think the rest of the code should handle labels containing emojis with space):

src/sync_template.sh

function maybe_create_labels () {
  all_labels=${PR_LABELS//,/$'\n'}
  for label in $all_labels
  do

e.g. with PR_LABELS=""📚 documentation, <next_labels>" (next_labels can be empty) the related for loop will first take 📚 and in next loop documentation.

Trying to solve this issue ASAP. (cannot promise today)

Remark
This issue has been introduced with #437 and related RP #438 .
As a workaround (not tested) I assume you can downgrade the action to v1.3.0 https://github.com/AndreasAugustin/actions-template-sync/blob/main/CHANGELOG.md#130-2024-01-18

but you need to manually add the label to the repository. (automatic add of a label to the repo has been added with #438). As said above I will try to solve the issue soon (next days)

@AndreasAugustin
Copy link
Owner

@all-contributors please add @kdeldycke for bug

Copy link
Contributor

@AndreasAugustin

I've put up a pull request to add @kdeldycke! 🎉

@AndreasAugustin
Copy link
Owner

AndreasAugustin commented Feb 25, 2024

@kdeldycke #462 will fix the bug. Tested with pr_labels: 📚 documentation,test (please note the that the second tag does not have a space prefix. The reason is the nature of gh cli).

Please update to v1.6.2 (or use v1.6 or v1 to get automatically latest minor/major for each run).

Please get back if you still face issues.

@kdeldycke
Copy link
Contributor Author

Thanks for the really fast fix! Just updated my workflows, I'll certainly have the confirmation soon that everything's fine with v1.6.2.

@kdeldycke
Copy link
Contributor Author

Just confirmed v1.6.2 fixed my issue! See: kdeldycke/awesome-engineering-team-management#90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
2 participants