Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Maksym Zavalniuk
Maksym Zavalniuk

Posted on

Format repo - GitHub Action to format your code with comfort

What I built

I made aGitHub action that automatically formats thePython andJavaScript code after each commit and pushes it to the repository.

Category Submission:

DIY Deployments

App Link

App ishere.

Screenshots

Example of action pt.1
Example of action pt.2

Description

The action installsblack _ and _prettier and uses them to formatPython andJavaScript code. After usinggit commands, changes are pushed to the repository.

Link to Source Code

Code ishere.

Permissive License

MIT License

Background (What made you decide to build this particular app? What inspired you?)

First, I wanted to make an action that would automatically push commits to GitLab and BitBucket, like a mirror. But there were difficulties with the API of these services. Then I decided to implement my old idea - an action that automatically formats the code. I tried to do it before with Docker and now with js, and it turned out to be much easier.

How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?)

I used the libraries fromactions/toolkit to create my action. It's more comfortable than when I did it with Docker. I looked at all the libraries, and most of all:actions/core,actions/exec andactions/github.

Additional Resources/Info

To use it, you need to enableworkflow read:write in the settings.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Good day! My name is Maksym. On my blog, you can find useful information about Python, JavaScript, and other programming tools.
  • Location
    Kyiv, Ukraine
  • Education
    NTUU "Igor Sikorsky KPI"
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp