Skip to content

Commit 9fc0f1e

Browse files
tablackburnclaude
andauthored
chore: pin line endings to LF via .gitattributes (#13)
Windows clones with global core.autocrlf=true rewrite the working tree to CRLF on checkout. Subsequent edits made through tooling that writes LF (most editors and AI agents do) trigger 'LF will be replaced by CRLF the next time Git touches it' warnings on every commit. Pinning eol=lf in .gitattributes overrides the contributor's global autocrlf setting for this repo and silences the warning. PowerShell on Windows handles LF fine. Renormalize touches 1 file with mixed line endings; content unchanged. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3646768 commit 9fc0f1e

2 files changed

Lines changed: 88 additions & 82 deletions

File tree

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Normalize line endings to LF in both the repo and the working tree, regardless of
2+
# the contributor's global core.autocrlf setting. PowerShell on Windows handles LF
3+
# fine. Without this, Windows clones with core.autocrlf=true emit "LF will be
4+
# replaced by CRLF the next time Git touches it" warnings on every commit when
5+
# files are edited by tooling that writes LF (most editors and AI agents do).
6+
* text=auto eol=lf
Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
name: Publish Module to PowerShell Gallery
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
paths:
8-
- 'ReScenePS/ReScenePS.psd1'
9-
workflow_dispatch:
10-
11-
permissions:
12-
contents: write
13-
14-
jobs:
15-
publish:
16-
name: Publish Module
17-
runs-on: ubuntu-latest
18-
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v6
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Get Module Version
25-
id: version
26-
shell: pwsh
27-
run: |
28-
$manifest = Import-PowerShellDataFile -Path ./ReScenePS/ReScenePS.psd1
29-
$version = $manifest.ModuleVersion
30-
Write-Host "Module version: $version"
31-
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
32-
33-
- name: Check if Release Exists
34-
id: check_release
35-
shell: bash
36-
env:
37-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
run: |
39-
if gh release view "v${{ steps.version.outputs.version }}" > /dev/null 2>&1; then
40-
echo "exists=true" >> $GITHUB_OUTPUT
41-
echo "GitHub release v${{ steps.version.outputs.version }} already exists"
42-
else
43-
echo "exists=false" >> $GITHUB_OUTPUT
44-
echo "GitHub release v${{ steps.version.outputs.version }} does not exist"
45-
fi
46-
47-
- name: Check if PSGallery Version Exists
48-
id: check_psgallery
49-
if: steps.check_release.outputs.exists == 'false'
50-
shell: pwsh
51-
run: |
52-
$version = "${{ steps.version.outputs.version }}"
53-
$published = Find-Module -Name ReScenePS -RequiredVersion $version -Repository PSGallery -ErrorAction SilentlyContinue
54-
if ($published) {
55-
Write-Host "PSGallery version $version already exists"
56-
"exists=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
57-
} else {
58-
Write-Host "PSGallery version $version not found - will publish"
59-
"exists=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
60-
}
61-
62-
- name: Bootstrap
63-
if: steps.check_release.outputs.exists == 'false'
64-
shell: pwsh
65-
run: ./build.ps1 -Task Init -Bootstrap
66-
67-
- name: Create GitHub Release
68-
if: steps.check_release.outputs.exists == 'false'
69-
shell: bash
70-
env:
71-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
run: |
73-
gh release create "v${{ steps.version.outputs.version }}" \
74-
--title "v${{ steps.version.outputs.version }}" \
75-
--generate-notes
76-
77-
- name: Publish to PSGallery
78-
if: steps.check_release.outputs.exists == 'false' && steps.check_psgallery.outputs.exists == 'false'
79-
shell: pwsh
80-
env:
81-
PSGALLERY_API_KEY: ${{ secrets.PS_GALLERY_KEY }}
82-
run: ./build.ps1 -Task Publish -Bootstrap
1+
name: Publish Module to PowerShell Gallery
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'ReScenePS/ReScenePS.psd1'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
publish:
16+
name: Publish Module
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Get Module Version
25+
id: version
26+
shell: pwsh
27+
run: |
28+
$manifest = Import-PowerShellDataFile -Path ./ReScenePS/ReScenePS.psd1
29+
$version = $manifest.ModuleVersion
30+
Write-Host "Module version: $version"
31+
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
32+
33+
- name: Check if Release Exists
34+
id: check_release
35+
shell: bash
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
if gh release view "v${{ steps.version.outputs.version }}" > /dev/null 2>&1; then
40+
echo "exists=true" >> $GITHUB_OUTPUT
41+
echo "GitHub release v${{ steps.version.outputs.version }} already exists"
42+
else
43+
echo "exists=false" >> $GITHUB_OUTPUT
44+
echo "GitHub release v${{ steps.version.outputs.version }} does not exist"
45+
fi
46+
47+
- name: Check if PSGallery Version Exists
48+
id: check_psgallery
49+
if: steps.check_release.outputs.exists == 'false'
50+
shell: pwsh
51+
run: |
52+
$version = "${{ steps.version.outputs.version }}"
53+
$published = Find-Module -Name ReScenePS -RequiredVersion $version -Repository PSGallery -ErrorAction SilentlyContinue
54+
if ($published) {
55+
Write-Host "PSGallery version $version already exists"
56+
"exists=true" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
57+
} else {
58+
Write-Host "PSGallery version $version not found - will publish"
59+
"exists=false" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
60+
}
61+
62+
- name: Bootstrap
63+
if: steps.check_release.outputs.exists == 'false'
64+
shell: pwsh
65+
run: ./build.ps1 -Task Init -Bootstrap
66+
67+
- name: Create GitHub Release
68+
if: steps.check_release.outputs.exists == 'false'
69+
shell: bash
70+
env:
71+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
run: |
73+
gh release create "v${{ steps.version.outputs.version }}" \
74+
--title "v${{ steps.version.outputs.version }}" \
75+
--generate-notes
76+
77+
- name: Publish to PSGallery
78+
if: steps.check_release.outputs.exists == 'false' && steps.check_psgallery.outputs.exists == 'false'
79+
shell: pwsh
80+
env:
81+
PSGALLERY_API_KEY: ${{ secrets.PS_GALLERY_KEY }}
82+
run: ./build.ps1 -Task Publish -Bootstrap

0 commit comments

Comments
 (0)