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

Workflow yaml file created with Windows (CR) line breaks #48

Open
Krinkle opened this issue Apr 18, 2021 · 3 comments
Open

Workflow yaml file created with Windows (CR) line breaks #48

Krinkle opened this issue Apr 18, 2021 · 3 comments

Comments

@Krinkle
Copy link
Contributor

Krinkle commented Apr 18, 2021

In grunt-contrib-qunit, I tried to update grunt-contrib-internal from v4 to latest v6 and noticed that after running ./node_modules/.bin/grunt build-contrib (from a container with Node.js 10, and Debian 9) it created the .github/workflows/test.yml file as follows:

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..6869813
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,39 @@
+name: Tests^M
+^M
+on: [push, pull_request]^M
+^M
+env:^M
+  FORCE_COLOR: 2^M
+^M
+jobs:^M
+  run:^M
+    name: Node ${{ matrix.node }} on ${{ matrix.os }}^M
+    runs-on: ${{ matrix.os }}^M
+^M
+    strategy:^M
+      fail-fast: false^M
+      matrix:^M
+        node: [10, 12, 14]^M
+        os: [ubuntu-latest, windows-latest]^M
+^M
+    steps:^M
+      - name: Clone repository^M
+        uses: actions/checkout@v2^M
+^M
+      - name: Set up Node.js^M
+        uses: actions/setup-node@v2^M
+        with:^M
+          node-version: ${{ matrix.node }}^M
+^M
+      - name: Install npm dependencies^M
+        run: npm ci^M
+^M
+      - name: Run tests^M
+        run: npm test^M
+^M
+      # We test multiple Windows shells because of prior stdout buffering issues^M
+      # filed against Grunt. https://github.com/joyent/node/issues/3584^M
+      - name: Run PowerShell tests^M
+        run: "npm test # PowerShell" # Pass comment to PS for easier debugging^M
+        shell: powershell^M
+        if: startsWith(matrix.os, 'windows')^M

And it modified CONTRIBUTING.md as well:

-… for information on contributing to this project.
+… for information on contributing to this project.^M
@XhmikosR
Copy link
Member

Weird, does it happen with the latest version?

@Krinkle
Copy link
Contributor Author

Krinkle commented Jul 2, 2023

@XhmikosR Yes, it is still enforcing Windows-style CRLF line breaks.

# 🌱 Fresh 23.05.1 ░ Node.js 16 ░ npm 7 ░ Firefox 102 ░ Chromium 112 ░ Debian 11 Bullseye

$ npm ls
[email protected] /grunt-contrib-qunit
├── [email protected]
├── [email protected]
…


$ npx grunt contrib-ci
Running "contrib-ci" task
>> Normalized GitHub Actions CI config for grunt-contrib.

$ git diff
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,41 +1,41 @@
-name: Tests
-
-on: [push, pull_request, workflow_dispatch]
-
-env:
…

+name: Tests^M
+^M
+on: [push, pull_request, workflow_dispatch]^M
+^M
+env:^
…

@XhmikosR
Copy link
Member

XhmikosR commented Jul 3, 2024

Does the repo you are including grunt-contrib-internal have the same .gitattributes file as this repo?

It's the only thing I can think of that might be causing the issue. Because the file is this repo do have LF since version 8.1.0, so theoretically if you use the same .gitattributes file you should be OK.

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

No branches or pull requests

2 participants