Unverified Commit 672174a5 authored by Ryan Troost's avatar Ryan Troost Committed by GitHub
Browse files

Merge pull request #606 from actions/v3/node16

Carry forward `v3/node16` updates to `v3/node20` 
parents 97a0fba1 9ee08a3b
Loading
Loading
Loading
Loading
+23
Changes for README.md: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -237,6 +237,29 @@ Artifacts are retained for 90 days by default. You can specify a shorter retenti

The retention period must be between 1 and 90 inclusive. For more information see [artifact and log retention policies](https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration#artifact-and-log-retention-policy).


### Hidden Files 

By default, hidden files are ignored by this action to avoid unintentionally uploading sensitive information.

In versions of this action before v3.2.0, these hidden files were included by default.

If you need to upload hidden files, you can use the `include-hidden-files` input.

```yaml
jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - name: Create a Hidden File
        run: echo "hello from a hidden file" > .hidden-file.txt
      - name: Upload Artifact
        uses: actions/upload-artifact@v3
        with:
          path: .hidden-file.txt
          include-hidden-files: true
```

## Where does the upload go?

At the bottom of the workflow summary page, there is a dedicated section for artifacts. Here's a screenshot of something you might see:
+51
Changes for __tests__/search.test.ts: 51 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -61,6 +61,20 @@ const lonelyFilePath = path.join(
  'lonely-file.txt'
)

const hiddenFile = path.join(root, '.hidden-file.txt')
const fileInHiddenFolderPath = path.join(
  root,
  '.hidden-folder',
  'folder-in-hidden-folder',
  'file.txt'
)
const fileInHiddenFolderInFolderA = path.join(
  root,
  'folder-a',
  '.hidden-folder-in-folder-a',
  'file.txt'
)

describe('Search', () => {
  beforeAll(async () => {
    // mock all output so that there is less noise when running tests
@@ -92,6 +106,13 @@ describe('Search', () => {
    await fs.mkdir(path.join(root, 'folder-h', 'folder-j', 'folder-k'), {
      recursive: true
    })
    await fs.mkdir(
      path.join(root, '.hidden-folder', 'folder-in-hidden-folder'),
      {recursive: true}
    )
    await fs.mkdir(path.join(root, 'folder-a', '.hidden-folder-in-folder-a'), {
      recursive: true
    })

    await fs.writeFile(searchItem1Path, 'search item1 file')
    await fs.writeFile(searchItem2Path, 'search item2 file')
@@ -110,10 +131,19 @@ describe('Search', () => {
    await fs.writeFile(amazingFileInFolderHPath, 'amazing file')

    await fs.writeFile(lonelyFilePath, 'all by itself')

    await fs.writeFile(hiddenFile, 'hidden file')
    await fs.writeFile(fileInHiddenFolderPath, 'file in hidden directory')
    await fs.writeFile(fileInHiddenFolderInFolderA, 'file in hidden directory')
    /*
      Directory structure of files that get created:
      root/
          .hidden-folder/
            folder-in-hidden-folder/
              file.txt
          folder-a/
              .hidden-folder-in-folder-a/
                file.txt
              folder-b/
                  folder-c/
                      search-item1.txt
@@ -136,6 +166,7 @@ describe('Search', () => {
              folder-j/
                  folder-k/
                      lonely-file.txt
          .hidden-file.txt
          search-item5.txt
    */
  })
@@ -352,4 +383,24 @@ describe('Search', () => {
    )
    expect(searchResult.filesToUpload.includes(lonelyFilePath)).toEqual(true)
  })

  it('Hidden files ignored by default', async () => {
    const searchPath = path.join(root, '**/*')
    const searchResult = await findFilesToUpload(searchPath)

    expect(searchResult.filesToUpload).not.toContain(hiddenFile)
    expect(searchResult.filesToUpload).not.toContain(fileInHiddenFolderPath)
    expect(searchResult.filesToUpload).not.toContain(
      fileInHiddenFolderInFolderA
    )
  })

  it('Hidden files included', async () => {
    const searchPath = path.join(root, '**/*')
    const searchResult = await findFilesToUpload(searchPath, true)

    expect(searchResult.filesToUpload).toContain(hiddenFile)
    expect(searchResult.filesToUpload).toContain(fileInHiddenFolderPath)
    expect(searchResult.filesToUpload).toContain(fileInHiddenFolderInFolderA)
  })
})
+5
Changes for action.yml: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ inputs:

      Minimum 1 day.
      Maximum 90 days unless changed from the repository settings page.
  include-hidden-files:
    description: >
      If true, hidden files will be included in the uploaded artifact.
      If false, hidden files will be excluded from the uploaded artifact.
    default: 'false'
runs:
  using: 'node20'
  main: 'dist/index.js'
+102 −53

File changed.

Preview size limit exceeded, changes collapsed.

+9 −9
Changes for package-lock.json: 9 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
      "dependencies": {
        "@actions/artifact": "^1.1.2",
        "@actions/core": "^1.10.0",
        "@actions/glob": "^0.3.0",
        "@actions/glob": "^0.5.0",
        "@actions/io": "^1.1.2"
      },
      "devDependencies": {
@@ -52,11 +52,11 @@
      }
    },
    "node_modules/@actions/glob": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
      "integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
      "version": "0.5.0",
      "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz",
      "integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==",
      "dependencies": {
        "@actions/core": "^1.2.6",
        "@actions/core": "^1.9.1",
        "minimatch": "^3.0.4"
      }
    },
@@ -6168,11 +6168,11 @@
      }
    },
    "@actions/glob": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
      "integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
      "version": "0.5.0",
      "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.5.0.tgz",
      "integrity": "sha512-tST2rjPvJLRZLuT9NMUtyBjvj9Yo0MiJS3ow004slMvm8GFM+Zv9HvMJ7HWzfUyJnGrJvDsYkWBaaG3YKXRtCw==",
      "requires": {
        "@actions/core": "^1.2.6",
        "@actions/core": "^1.9.1",
        "minimatch": "^3.0.4"
      }
    },
Loading