question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix code formatting github action

See original GitHub issue

🐛 Bug description

Currently, auto code formatting GA: https://github.com/pytorch/ignite/actions/workflows/code-style.yml does not on forks and fails while try to commit/push the fix to the fork. This gives a misleading error to the user without helping how to solve it. Currently this action is disabled.

The idea is to find out what is the cause of the failure and fix it if possible.

Environment

  • PyTorch Version (e.g., 1.4):
  • Ignite Version (e.g., 0.3.0):
  • OS (e.g., Linux):
  • How you installed Ignite (conda, pip, source):
  • Python version:
  • Any other relevant information:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vfdev-5commented, Feb 21, 2021

Thanks for the info and the link. Shouldn’t we do like in the example: https://github.com/stefanzweifel/git-auto-commit-action#example-2 but adapted for us :

  • add pull_request_target

We can inspect what happens in both cases: a) GitHub Action is enabled on the forked repository. b) GitHub Action is disabled on the forked repository.

1reaction
trsvchncommented, Feb 21, 2021

@vfdev-5 After quick view at the stefanzweifel/git-auto-commit-action@v4 I found this recomendation:

You must use action/checkout@v2 or later versions to checkout the repository. In non-push events, such as pull_request, make sure to specify the ref to checkout:

- uses: actions/checkout@v2
  with:
    ref: ${{ github.head_ref }}

And, also, there is a recipe how to use it with forks:

https://github.com/stefanzweifel/git-auto-commit-action#using-the-action-in-forks-from-public-repositories

And this:

For Workflows which runter linters and fixers (like the example above) we recommend running them when a push happens on the master-branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Actions: How to Automate Code Formatting in Pull ...
How to automatically format code and push it to the pull request branch with GitHub Actions.
Read more >
Prettier Action · Actions · GitHub Marketplace
GitHub Prettier Action. CodeFactor code style: prettier License MIT Latest Release Contributors Issues. A GitHub action for styling files with prettier.
Read more >
Marketplace Actions Run black formatter - GitHub
This action runs the black formatter to check/format your python code on a push or pull request. It is similar to reviewdog/action-black that...
Read more >
Black Code Formatter · Actions · GitHub Marketplace
Black Code Formatter GitHub Action. A GitHub action that runs black code formatter for Python. Example Workflow. workflow "Example Workflow" { on =...
Read more >
Node Code Formatter - GitHub Action
Usage ✏️ · Create a formatter.yml file in .github/workflows/ · Paste this code into the file:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found