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

feat: change labeler action for more smarter regex #61946

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

casswedson
Copy link
Contributor

@casswedson casswedson commented Oct 27, 2022

Summary

None

Purpose of change

I want to change the labeler action such that it is capable of substring searches, they are the bulk of the labeling rules and very much the smart part of this little workflow, if it can't do semi smart moves then someone will step up and do the hard work; I am looking for better smarter automation

Describe the solution

use this action; pretty much the same, only it's better

see this pr for testing casswedson#68

  • it does file extension detection
    if I change json and .h or .cpp files it applies json and c++ labels
  • directory searches
    if I change some data/mods/innawood/ file it adds the innawod mods labels because the have separate rules that happen to meet here
  • substring searches
    if I change data/json/deconstruction.json it adds the crafting / construction / etc label cuz it looks for (among others) the substring construction
    if I change data/mods/innawood/traps.json it adds the furniture / traps labels cuz it looks for (among others) the substring traps

there's also the action's output that list the files changed, labeling rules and labels to be applied; very useful https://github.com/casswedson/Cataclysm-DDA/actions/runs/3334016607/jobs/5516537963#step:4:17

also number 2. we did lose a little logic, I am not so sure how to replicate it, in time I'm sure I'll figure it out, I just need to get the heavy work done first

also number 3. this runs on the pull_request event now (won't work otherwise) just a note

Describe alternatives you've considered

Testing

yes

Additional context

@github-actions github-actions bot added the Code: Tooling Tooling that is not part of the main game but is part of the repo. label Oct 27, 2022
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 27, 2022
@dseguin dseguin merged commit 088ce11 into CleverRaven:master Oct 28, 2022
@casswedson casswedson deleted the now-you-do-substrings branch October 28, 2022 22:50
casswedson added a commit to casswedson/Cataclysm-DDA that referenced this pull request Oct 28, 2022
@BrettDong
Copy link
Member

Workflows running on pull_request events have read-only permission. For write permission it needs to run on a trusted environment like pull_request_target.
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

@casswedson
Copy link
Contributor Author

I know for certain this does not work if I change the event trigger
I just re-tested that to be extra sure here casswedson#69 the output https://github.com/casswedson/Cataclysm-DDA/actions/runs/3351962862/jobs/5553766523
a pic to illustrate the point
image

the action is probably just old

@BrettDong
Copy link
Member

@casswedson
Copy link
Contributor Author

I'm gonna be digging in its code; maybe I'll figure something out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Tooling Tooling that is not part of the main game but is part of the repo. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants