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

Error with multiline packages using black scalar styles > and | in YAML. #84

Closed
einverne opened this issue Jan 4, 2023 · 7 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@einverne
Copy link

einverne commented Jan 4, 2023

      - name: Install dependencies for Ubuntu
        if: matrix.os == 'ubuntu-latest'
        uses: awalsh128/cache-apt-pkgs-action@latest
        with:
          packages: >
            libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev
            libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
          version: 1.0

Error log:

For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Error: Artifact name is not valid: cache-apt-pkgs-logs%libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
%1. Contains the following character:  Line feed \n
          
Invalid characters include:  Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n, Backslash \, Forward slash /
          
These characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.

Version: 1.2.2 lastest

GitHub Actions can use the Folded Block Scalar syntax. But It seems failed in the latest version.

@Stas-AbsoluteDesign
Copy link

Stas-AbsoluteDesign commented Jan 17, 2023

The same happens when you do a multiline split. The line is 494 characters long, so ofc you want it to look nicer and split to a multiline one.
So it actually runs installation OK but fails on the very last step of caching.

  uses: awalsh128/cache-apt-pkgs-action@latest
  with:
    packages: |
      wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 \
      libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgconf-2-4 libgdk-pixbuf2.0-0 libstdc++6 \
      libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libappindicator1 \
      libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
      libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libatk-bridge2.0-0 \
      libx11-6 libnss3 lsb-release xdg-utils
    version: 1.0

Result:

23:21:10 Clean installing 41 packages...
23:21:12 done
23:21:12 Installation log written to /home/runner/cache-apt-pkgs/install.log

23:21:12 Installed package list:

23:21:12 Caching 0 installed packages...
23:21:12 done (total cache size 16K)

23:21:12 Skipped all manifest write. No packages to install.

cat: /home/runner/cache-apt-pkgs/manifest_all.log: No such file or directory
/home/runner/actions-runner/_work/_temp/af04a2e5-5d86-4f61-91ed-5f1af2a786e4.sh: line 14: -1: substring expression < 0
Run actions/upload-artifact@v3
With the provided path, there will be 2 files uploaded
Starting artifact upload
For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Error: Artifact name is not valid: cache-apt-pkgs-logs%wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 \
libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgconf-2-4 libgdk-pixbuf2.0-0 libstdc++6 \
libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libappindicator1 \
libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libatk-bridge2.0-0 \
libx11-6 libnss3 lsb-release xdg-utils
%1. Contains the following character:  Line feed \n
          
Invalid characters include:  Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n, Backslash \, Forward slash /
          
These characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.

Full log:
https://pastebin.com/B5m9phrk

@awalsh128
Copy link
Owner

Sorry for the lag here. I'll add a regression for it and address this. Shouldn't be too hard.

@awalsh128
Copy link
Owner

Regressions added on CI.

awalsh128/cache-apt-pkgs-action-ci@7f6a191

awalsh128 added a commit that referenced this issue Feb 4, 2023
@awalsh128 awalsh128 changed the title Error when having multiple lines of packages using > in yaml Error with multiline packages using black scalar styles '>' and '|' in YAML. Feb 4, 2023
@awalsh128 awalsh128 changed the title Error with multiline packages using black scalar styles '>' and '|' in YAML. Error with multiline packages using black scalar styles > and | in YAML. Feb 4, 2023
@awalsh128
Copy link
Owner

@panzi it looks like backslashes get retained in the block scalar literal style. Your suggestions did fix the previous issue so we are making progress.

https://github.com/awalsh128/cache-apt-pkgs-action-ci/actions/runs/4090270692/jobs/7053564102

I could strip these but it would seem more intuitive that these get omitted since it is part of the YAML syntax and is not a literal. In any case, going to do some more digging and try to find an elegant solution.

@awalsh128 awalsh128 added the bug Something isn't working label Feb 4, 2023
awalsh128 added a commit that referenced this issue Feb 4, 2023
* Address block style package issue #84 #88

* Use cache key for upload artifact name #89.

* Sync master back to dev. (#92)

* Fix if condition for upload-logs step (#87)

Previously the if condition was always evaluating to a truthy string
(e.g. 'false == "true"' or 'true == "true"') as the string comparison
(`== 'true'`) was not inside the expression syntax (`${{ }}`) and thus
being treated as a string rather than being evaluated.

* Introduce a force update value for reloading cache #82

---------

Co-authored-by: Leroy Hopson <github@leroy.geek.nz>

---------

Co-authored-by: Leroy Hopson <github@leroy.geek.nz>
@awalsh128
Copy link
Owner

Regressions are passing now.

https://github.com/awalsh128/cache-apt-pkgs-action-ci/actions/runs/4098253383

Going to cut a release and close this out v1.2.4.

@awalsh128
Copy link
Owner

@Stas-AbsoluteDesign
Copy link

Thank you @awalsh128 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants