z0al / dependent-issues

πŸ“¦ A GitHub Action for marking issues as dependent on another

Home Page:https://github.com/marketplace/actions/dependent-issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Comment is too spammy

mandolaerik opened this issue Β· comments

Hi,

The default message is too spammy in my taste, I much prefer a minimal clean comment as seen in https://github.com/Levi-Lesches/blocking-issues

I have created a fork that adapts Dependent Issues to something similar: https://github.com/mandolaerik/dependent-issues

Would it make sense to at least make this configurable?

commented

Would it make sense to at least make this configurable?

πŸ’―. Would you be able to work on that?

We could support {{ dependencies }} token so you can place the list wherever you want. For example

# ...
with:
  comment:
    "This PR is blocked by:

    {{ dependencies }}

    Have a nice day!"

In the code we could do a simple match and replace:

customMessage.replace(/\{\{\s*dependencies\s*\}\}/i, dependenciesString)

I guess that's pretty much it.

I could look into it. However, I have some problems with the build/test workflow; I'm new to yarn (I managed to run tests, but could not compile into index.js; I patched it manually in my fork to get the job done). What's the steps for building what's needed for a PR?

commented

Try running the following commands @mandolaerik :

yarn build      # should compile TypeScript files
yarn package    # Should bundle files into a single dist/index.js file. See https://github.com/vercel/ncc
commented

I should add a contributing guide 😞

Build gives me:

$ yarn build
yarn run v1.22.10
$ tsc
src/action.ts:13:18 - error TS2571: Object is of type 'unknown'.

13   core.setFailed(error.stack || error.message);
                    ~~~~~

src/action.ts:13:33 - error TS2571: Object is of type 'unknown'.

13   core.setFailed(error.stack || error.message);
                                   ~~~~~

Found 2 errors.

Works after this patch:

--- a/src/action.ts
+++ b/src/action.ts
@@ -10,6 +10,10 @@ export async function start() {
        try {
                await checkIssues(await getActionContext());
        } catch (error) {
-               core.setFailed(error.stack || error.message);
+               if (error instanceof Error) {
+                       core.setFailed(error.stack || error.message);
+               } else {
+                       core.setFailed(`${error}`);
+               }
        }
 }
commented

It looks you're using a later version of Typescript

Anyway, the patch you did looks great πŸ‘

πŸŽ‰ This issue has been resolved in version 1.5.0 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€