From cf800eb5f070f6dc0367e146a06738d2bd2491d6 Mon Sep 17 00:00:00 2001 From: Rian Koja <44759271+RianKoja@users.noreply.github.com> Date: Fri, 16 Oct 2026 13:47:41 -0300 Subject: [PATCH] Update GitHub Actions to current versions (#6) * Update GitHub Actions to current versions * Mark PDF files as binary to keep byte offsets intact on Windows * Skip existing symbolic links when extracting attachments on Windows --- .gitattributes | 1 + .github/workflows/Build.yml | 31 +++++++++---------------------- src/PDAttachment.jl | 3 +++ 3 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d72fd52 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.pdf binary diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index b24e950..c51ce23 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -9,7 +9,7 @@ on: jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.version == 'nightly' }} strategy: @@ -21,43 +21,30 @@ jobs: - 'nightly' os: - ubuntu-latest - arch: - - x64 include: # test macOS and Windows with latest Julia only - os: macOS-latest - arch: x64 version: 1 - os: windows-latest - arch: x64 version: 1 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v3 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v7 with: - file: lcov.info + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 with: version: '1' - name: Install dependencies diff --git a/src/PDAttachment.jl b/src/PDAttachment.jl index 26cf9b4..8bdc099 100644 --- a/src/PDAttachment.jl +++ b/src/PDAttachment.jl @@ -66,6 +66,9 @@ function create_new_file(dir::AbstractString, name::String) base, ext = splitext(name) for i = 0:typemax(Int16) path = joinpath(dir, i == 0 ? name : string(base, " (", i, ")", ext)) + # On Windows `O_EXCL` still follows a dangling symbolic link. This check + # does not cover a link created between it and the `open`. + islink(path) && continue try flags = Base.Filesystem.JL_O_WRONLY | Base.Filesystem.JL_O_CREAT | Base.Filesystem.JL_O_EXCL