Hi,
We're using code autoformat tools locally but need to move them to pipeline. How do we commit changes applied by autoformat tools in pipeline directly?
After formatting code in the pipeline, we just commit it like this: i used it for SR Blinds the same process.
Make sure the pipeline has permission to push changes.
Run your formatter (like Prettier, ESLint, etc.).
Use Git commands to commit and push:
<span>git </span><span>config </span><span>--global </span><span>user.email </span><span>"pipeline@srblinds.com"</span> <span>git </span><span>config </span><span>--global </span><span>user.name </span><span>"SR Blinds Bot"</span> <span>git </span><span>add </span><span>.</span><span>git </span><span>commit </span><span>-m </span><span>"chore: auto-format code [skip ci]"</span> <span>git </span><span>push </span><span>origin </span><span>HEAD:main</span>
That [skip ci] part helps avoid triggering the pipeline again. Quick and clean.
[skip ci]
cool, thanks a lot!
will try it asap and let you know.
worked (with some tiny updates to our needs) as proposed. thanks.
It looks like you're new here. Sign in or register to get started.