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

chore: create action to auto-label extension and linting issues #3589

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

straker
Copy link
Contributor

@straker straker commented Aug 9, 2022

With the new issue forms, we can now auto-assign opened issues with the extension or linting labels based on the Product dropdown. It was difficult to figure out the proper matching of newline characters.

You can see it working https://github.com/straker/issue-template-tests/issues and https://github.com/straker/issue-template-tests/actions

@straker straker requested a review from a team as a code owner August 9, 2022 15:43
.github/workflows/label-extension-linter-issues.yml Outdated Show resolved Hide resolved
steps:
- name: Label Extension Issues
uses: andymckay/[email protected]
if: contains(toJson(github.event.issue.body), '### Product\n\naxe Extension\n\n')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why convert this to JSON?

Copy link
Contributor Author

@straker straker Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the only way to get matching of newlines to work. Just the body would not match any newline character combinations I tried (\n, \r\n, etc.). https://stackoverflow.com/questions/61238849/github-actions-if-contains-function-not-working-with-env-variable

You can see all the things I tried using the body and toJson https://github.com/straker/issue-template-tests/runs/7749582494?check_suite_focus=true

@straker straker merged commit a6b015d into develop Aug 12, 2022
@straker straker deleted the label-action branch August 12, 2022 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants