Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs enhancement: Guide to use ABAP Cleaner in Github Workflow #127

Closed
stockbal opened this issue Oct 2, 2023 · 3 comments
Closed

Docs enhancement: Guide to use ABAP Cleaner in Github Workflow #127

stockbal opened this issue Oct 2, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@stockbal
Copy link
Contributor

stockbal commented Oct 2, 2023

Hi Jörg-Michael,

I now got a first working version of a Github Action Workflow that uses ABAP Cleaner 😄.
As I am not a GitHub Workflow expert by far, I am not sure if it is the best approach to do it, but hey, it is working.

Here is the workflow in my sample repository. I only had one minor hickup after the job first ran and I tried to import the changes back into my ABAP system.
After a little bit of debugging I found the culprit... crlf 😋. abapGit is splitting the received text content from git at lf into an internal table. The left behind carriage return is then seen as unknown statement and the import fails.

In a local setup the crlf characters written by ABAP cleaner never caused this because of the git setting core.autocrlf = true. And luckily enough this can also be set inside the workflow. So an additional step before the checkout solved it.

    - run: git config --global core.autocrlf true

    - name: Checkout
      uses: actions/checkout@v3

After that additional file changes via the workflow could be imported back to the ABAP system without any issue.

All the best,
Ludwig

@jmgrassau
Copy link
Member

Hi Ludwig,

that's amazing!! Hardly any GitHub Workflow knowledge on my side, but could you try changing the hard-coded release number into this: releases/download/v1.6.0/ -> releases/latest/download/

https://github.com/SAP/abap-cleaner/releases/latest/download/com.sap.adt.abapcleaner.app-linux.gtk.x86_64.tar.gz

After a little bit of debugging I found the culprit...

Oops 😉 Yes, the world would be a better place without / versus \ or crlf versus lf

Kind regards,
Jörg-Michael

@stockbal
Copy link
Contributor Author

stockbal commented Oct 2, 2023

Hi Jörg-Michael,

Ah, I knew there was a way to get the latest release 👍🚀 . Change is done, works like a charm.

Kind regards,
Ludwig

@jmgrassau jmgrassau added the documentation Improvements or additions to documentation label Oct 2, 2023
@jmgrassau jmgrassau self-assigned this Oct 10, 2023
jmgrassau added a commit to jmgrassau/abap-cleaner that referenced this issue Oct 10, 2023
@jmgrassau
Copy link
Member

Hi Ludwig,

the How to use ABAP cleaner documentation was now enhanced with a section on GitHub Actions workflow usage! Hope this is as you expected it to be – otherwise please let me know. And again thanks so much for you contributions!

Kind regards,
Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants