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: add actor token interpolation for comments #2

Merged

Conversation

sparten11740
Copy link
Collaborator

@sparten11740 sparten11740 commented Nov 30, 2022

Summary

The code of this action was (and still is in large parts) quite filthy. I extracted and cleaned up a few things that I touched to at least achieve a little bit of structure.

Main goal of this PR is to enable token interpolation in comment strings provided to the action. So far <%= author %> is supported. Example usage:

- name: Label PRs
  uses: './actions-label-merge-conflict'
  with:
    dirtyLabel: 'blocked/needs-rebase'
    repoToken: '${{ secrets.GITHUB_TOKEN }}'
    commentOnDirty: 'Houston, this is Conflict Bot. We have a conflict. @<%= author %> please rebase. Acknowledge.'
    retryAfter: 45

Testplan

Successfully tested in https://github.com/ExodusMovement/lerna-version-selectively/pull/135 by setting ref of the action to checkout this repo to this PR's branch (sparten11740/feat/add-placeholder-interpolation-to-messages)

Further comments

  • The build output is checked in under dist/index.js. No need to review the file.
  • The code formatting styles are really weird, I will add our linting/formatting rules in a follow up PR

@sparten11740 sparten11740 added the enhancement New feature or request label Nov 30, 2022
@sparten11740 sparten11740 self-assigned this Nov 30, 2022
Copy link
Collaborator

@mvayngrib mvayngrib left a comment

Choose a reason for hiding this comment

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

utACK

owner: "WayneFoundation",
repo: "batcave",
issue_number: issueNumber,
body: "Houston, this is Conflict Lord Bot. We have a conflict. I repeat, we have a conflict. @brucewayne please rebase. Acknowledge.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't leave me hanging man, did he rebase it in the end?

Copy link

@andrejborstnik andrejborstnik Nov 30, 2022

Choose a reason for hiding this comment

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

https://github.com/brucewayne will love this if we opensource hydra 🤣 (but please keep it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what a shame that such a prestigious handle is wasted on a completely inactive account...

Copy link

@andrejborstnik andrejborstnik left a comment

Choose a reason for hiding this comment

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

utACK

@sparten11740 sparten11740 merged commit c38e257 into main Dec 1, 2022
@sparten11740 sparten11740 deleted the sparten11740/feat/add-placeholder-interpolation-to-messages branch December 1, 2022 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants