Skip to content

Workflow run from comment to get format auto commit.#170

Closed
Tatsinnit wants to merge 1 commit into
Azure:mainfrom
Tatsinnit:feat/format-run-from-comment
Closed

Workflow run from comment to get format auto commit.#170
Tatsinnit wants to merge 1 commit into
Azure:mainfrom
Tatsinnit:feat/format-run-from-comment

Conversation

@Tatsinnit

@Tatsinnit Tatsinnit commented Jun 24, 2025

Copy link
Copy Markdown
Member

This is for the case where users who are maintainers will be able to run the prettier write against a repo by simply calling this /format from the comment and it will auto add the commit for the format.

This is phase-1 in the second phase - we will add the husky pre-commit formatter as well, that will require some setting form the user but we can always hook for the repo as a script command run from the machine like npm run setup-husky-pre-commit-check

Please don't worry about the current prettier issue it's because we surpassed one rule which I've enabled it again. = )

Thanks

@Tatsinnit Tatsinnit self-assigned this Jun 24, 2025
@Tatsinnit Tatsinnit added the enhancement New feature or request label Jun 24, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a GitHub Actions workflow to automatically run Prettier formatting on a PR when a maintainer comments /format, and updates the Prettier dependency to allow minor/patch bumps.

  • Switches prettier dependency in package.json to a caret range
  • Introduces .github/workflows/format-from-comment.yml to trigger and commit formatting via an issue comment

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
package.json Changed Prettier from an exact version to a caret range
.github/workflows/format-from-comment.yml New workflow to run npm run format and auto-commit changes
Comments suppressed due to low confidence (2)

.github/workflows/format-from-comment.yml:20

  • Pinning to a commit SHA prevents automatic patch updates; consider using a version tag like actions/checkout@v3 for maintainability.
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

.github/workflows/format-from-comment.yml:27

  • Pinning to a commit SHA here also locks you out of receiving fixes; using actions/setup-node@v3 ensures you get updates without unexpected major changes.
        uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020

Comment thread package.json
@Tatsinnit Tatsinnit force-pushed the feat/format-run-from-comment branch 6 times, most recently from d48e2a5 to 809fff7 Compare June 24, 2025 05:56
Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
@Tatsinnit Tatsinnit force-pushed the feat/format-run-from-comment branch from 809fff7 to c4de3cb Compare June 24, 2025 06:06
Comment thread .github/workflows/format-from-comment.yml
@davidgamero

Copy link
Copy Markdown
Collaborator

based on the that test workflow run it looks like the commits are not signed?

@bosesuneha

bosesuneha commented Jun 24, 2025

Copy link
Copy Markdown
Member

why not add a pre-commit hook directly?

@Tatsinnit

Copy link
Copy Markdown
Member Author

based on the that test workflow run it looks like the commits are not signed?

Yeah that I did noticed :) latter in night, hence I park this PR for ease and FYI - the only advantage for this comment hook could be when everyone are in fly and we need something quick to fix for prettier. (aka folks away from machine)

@Tatsinnit

Copy link
Copy Markdown
Member Author

why not add a pre-commit hook directly?

Ah you mean host machine hook or directly at repo level, for repo level it might need some sort of setting with shell, yeah let me play around more.

@bosesuneha

Copy link
Copy Markdown
Member

why not add a pre-commit hook directly?

Ah you mean host machine hook or directly at repo level, for repo level it might need some sort of setting with shell, yeah let me play around more.

I meant having a pre-commit hook in the repo

@Tatsinnit

Copy link
Copy Markdown
Member Author

why not add a pre-commit hook directly?

Ah you mean host machine hook or directly at repo level, for repo level it might need some sort of setting with shell, yeah let me play around more.

I meant having a pre-commit hook in the repo

#171 I guess fits what you jsut said and it does make sense, thank you = )

@Tatsinnit

Copy link
Copy Markdown
Member Author

Closing in favour of #171 , thanks!

@Tatsinnit Tatsinnit closed this Jul 1, 2025
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.

4 participants