Skip to content

Conversation

@tjgurwara99
Copy link
Member

A simple transformation to make the formatter script as an action that would be made reusable by using the actions api without relying on wget

@tjgurwara99
Copy link
Member Author

tjgurwara99 commented Dec 17, 2022

@Panquesito7 This is what I was talking about. The usage is quite straight forward now, you just have to just add these in the workflow file as a step - this won't commit the changes like git mv does since I don't want the action to be able to do that - only the main calling action should do that.

jobs:
  formatter:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: ./formatter
        with:
          filetypes: .cpp,.hpp
          working-directory: .

@tjgurwara99 tjgurwara99 changed the title Make the formatter script as an action Make the formatter script an action Dec 17, 2022
@Panquesito7 Panquesito7 added the enhancement New feature or request label Dec 17, 2022
@Panquesito7
Copy link
Member

I'll work tomorrow on making the DIRECTORY.md script a GitHub Actions workflow as well to make it much easier. 🙂

@@ -0,0 +1,13 @@
name: Test
Copy link
Member

Choose a reason for hiding this comment

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

We can probably merge both workflows and have them in one place to make things shorter/cleaner.

Copy link
Member Author

@tjgurwara99 tjgurwara99 Dec 18, 2022

Choose a reason for hiding this comment

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

If we merge them then if either one of them fails, we won't know until we dig deeper which scenario failed. I prefer to keep them separate so I can just glance and know which one failed, if that makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

With multiple jobs, we can see which one passed or not in the same workflow. It'll be longer but can be easier to check, IMO.

Copy link
Member Author

@tjgurwara99 tjgurwara99 Dec 19, 2022

Choose a reason for hiding this comment

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

Consider this: if we have two of these (let's call A and B) then when we have them in the same file, there must be an order which must be followed. Say first A then B - in this scenario, if A fails we don't know whether B is working as expected because the whole workflow stops execution. That's why I'm against it, and unless you're worried about the runner costs here, I think it should be okay to keep them separate... What do you think? I can place them in a single file easily just wanted to note this caveat before I do and ask your opinion on it.

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks! 🚀

@Panquesito7 Panquesito7 merged commit dee3bce into TheAlgorithms:main Dec 21, 2022
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.

2 participants