▲ 27 ▼ The Pain That is GitHub Actions - Feldera Blog (www.feldera.com) submitted 1 year ago by Kissaki@programming.dev to c/programming@programming.dev 27 comments fedilink hide all child comments
[–] lemmeBe@sh.itjust.works [B] 12 points 1 year ago (4 children) Do formatting and linting and such autofix issues automatically as part of pre-commit checks. That way they don't end up as part of the CI. permalink fedilink source hideshow 8 child comments replies: [–] catalyst@lemmy.world 8 points 1 year ago (1 child) Agreed. The idea of throwing code up at the CI and expecting it to fix my mistakes seems like a bad habit to me. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] 7 points 1 year ago Yep, I'd say so too. The moment I read the part about formatting in the CI, I thought to myself: I don't think GitHub Actions are the problem at hand. 😄 permalink fedilink source parent [–] FizzyOrange@programming.dev 7 points 1 year ago (1 child) You need them in CI anyway to check people have actually done that, but yeah you definitely don't need to have CI automatically fix formatting and commit the fixes. That's crazy. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -4 points 1 year ago* (1 child) No, you don't. To check if people have done what - committed? That's the only thing they need to do, and they'll stumble upon a roadblock immediately if the typecheck or lint fails. Committing itself won't be possible... That's why we have automated pre-commit checks that don't depend on people remembering to do them manually. permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 4 points 1 year ago (1 child) To check that people ran the pre-commit linters. Committing itself won’t be possible That's not how pre-commit hooks work. They're entirely optional and opt-in. You need CI to also run them to ensure people don't forget. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -2 points 1 year ago (1 child) They're optional if you make them optional. I didn't. You do as you please. 😄 permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 5 points 1 year ago (1 child) No, they're inherently optional in Git. There's no way to "check in" a git hook. You have to put in your README Clone the repo and then please run pre-commit install! Oh and whatever you do don't git commit --no-verify! You definitely need to actually check the lints in CI. It's very easy though, just add pre-commit run -a to your CI script. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent [–] normalexit@lemmy.world 3 points 1 year ago This is the way. I do my checks on pre push because my team has a PR driven workflow. I also have an alias to run-tests && git push origin HEAD since my tests are expensive (minutes to run thousands of tests), and I didn't want that in a git hook. permalink fedilink source parent [–] Flipper@feddit.org 2 points 1 year ago (1 child) If it's open source I'd still add it, because a lot of people can't follow basic instructions. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -1 points 1 year ago (1 child) They don't have to follow anything except try to commit their changes. Won't be possible even locally if linting or typechecking fail. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago Pre-commit hooks can’t be installed automatically and most people won’t even know they exist. permalink fedilink source parent
[–] catalyst@lemmy.world 8 points 1 year ago (1 child) Agreed. The idea of throwing code up at the CI and expecting it to fix my mistakes seems like a bad habit to me. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] 7 points 1 year ago Yep, I'd say so too. The moment I read the part about formatting in the CI, I thought to myself: I don't think GitHub Actions are the problem at hand. 😄 permalink fedilink source parent
[–] lemmeBe@sh.itjust.works [B] 7 points 1 year ago Yep, I'd say so too. The moment I read the part about formatting in the CI, I thought to myself: I don't think GitHub Actions are the problem at hand. 😄 permalink fedilink source parent
[–] FizzyOrange@programming.dev 7 points 1 year ago (1 child) You need them in CI anyway to check people have actually done that, but yeah you definitely don't need to have CI automatically fix formatting and commit the fixes. That's crazy. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -4 points 1 year ago* (1 child) No, you don't. To check if people have done what - committed? That's the only thing they need to do, and they'll stumble upon a roadblock immediately if the typecheck or lint fails. Committing itself won't be possible... That's why we have automated pre-commit checks that don't depend on people remembering to do them manually. permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 4 points 1 year ago (1 child) To check that people ran the pre-commit linters. Committing itself won’t be possible That's not how pre-commit hooks work. They're entirely optional and opt-in. You need CI to also run them to ensure people don't forget. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -2 points 1 year ago (1 child) They're optional if you make them optional. I didn't. You do as you please. 😄 permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 5 points 1 year ago (1 child) No, they're inherently optional in Git. There's no way to "check in" a git hook. You have to put in your README Clone the repo and then please run pre-commit install! Oh and whatever you do don't git commit --no-verify! You definitely need to actually check the lints in CI. It's very easy though, just add pre-commit run -a to your CI script. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent
[–] lemmeBe@sh.itjust.works [B] -4 points 1 year ago* (1 child) No, you don't. To check if people have done what - committed? That's the only thing they need to do, and they'll stumble upon a roadblock immediately if the typecheck or lint fails. Committing itself won't be possible... That's why we have automated pre-commit checks that don't depend on people remembering to do them manually. permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 4 points 1 year ago (1 child) To check that people ran the pre-commit linters. Committing itself won’t be possible That's not how pre-commit hooks work. They're entirely optional and opt-in. You need CI to also run them to ensure people don't forget. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -2 points 1 year ago (1 child) They're optional if you make them optional. I didn't. You do as you please. 😄 permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 5 points 1 year ago (1 child) No, they're inherently optional in Git. There's no way to "check in" a git hook. You have to put in your README Clone the repo and then please run pre-commit install! Oh and whatever you do don't git commit --no-verify! You definitely need to actually check the lints in CI. It's very easy though, just add pre-commit run -a to your CI script. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent
[–] FizzyOrange@programming.dev 4 points 1 year ago (1 child) To check that people ran the pre-commit linters. Committing itself won’t be possible That's not how pre-commit hooks work. They're entirely optional and opt-in. You need CI to also run them to ensure people don't forget. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -2 points 1 year ago (1 child) They're optional if you make them optional. I didn't. You do as you please. 😄 permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 5 points 1 year ago (1 child) No, they're inherently optional in Git. There's no way to "check in" a git hook. You have to put in your README Clone the repo and then please run pre-commit install! Oh and whatever you do don't git commit --no-verify! You definitely need to actually check the lints in CI. It's very easy though, just add pre-commit run -a to your CI script. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent
[–] lemmeBe@sh.itjust.works [B] -2 points 1 year ago (1 child) They're optional if you make them optional. I didn't. You do as you please. 😄 permalink fedilink source parent hideshow 2 child comments replies: [–] FizzyOrange@programming.dev 5 points 1 year ago (1 child) No, they're inherently optional in Git. There's no way to "check in" a git hook. You have to put in your README Clone the repo and then please run pre-commit install! Oh and whatever you do don't git commit --no-verify! You definitely need to actually check the lints in CI. It's very easy though, just add pre-commit run -a to your CI script. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent
[–] FizzyOrange@programming.dev 5 points 1 year ago (1 child) No, they're inherently optional in Git. There's no way to "check in" a git hook. You have to put in your README Clone the repo and then please run pre-commit install! Oh and whatever you do don't git commit --no-verify! You definitely need to actually check the lints in CI. It's very easy though, just add pre-commit run -a to your CI script. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent
[–] bamboo@lemm.ee 2 points 1 year ago pre-commit also has a free service for open source GitHub repos too. They’ll even push an autofix commit for you if your tools are configured for it permalink fedilink source parent
[–] normalexit@lemmy.world 3 points 1 year ago This is the way. I do my checks on pre push because my team has a PR driven workflow. I also have an alias to run-tests && git push origin HEAD since my tests are expensive (minutes to run thousands of tests), and I didn't want that in a git hook. permalink fedilink source parent
[–] Flipper@feddit.org 2 points 1 year ago (1 child) If it's open source I'd still add it, because a lot of people can't follow basic instructions. permalink fedilink source parent hideshow 2 child comments replies: [–] lemmeBe@sh.itjust.works [B] -1 points 1 year ago (1 child) They don't have to follow anything except try to commit their changes. Won't be possible even locally if linting or typechecking fail. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago Pre-commit hooks can’t be installed automatically and most people won’t even know they exist. permalink fedilink source parent
[–] lemmeBe@sh.itjust.works [B] -1 points 1 year ago (1 child) They don't have to follow anything except try to commit their changes. Won't be possible even locally if linting or typechecking fail. permalink fedilink source parent hideshow 2 child comments replies: [–] bamboo@lemm.ee 2 points 1 year ago Pre-commit hooks can’t be installed automatically and most people won’t even know they exist. permalink fedilink source parent
[–] bamboo@lemm.ee 2 points 1 year ago Pre-commit hooks can’t be installed automatically and most people won’t even know they exist. permalink fedilink source parent