diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml index db3e37f..53902ee 100644 --- a/.github/workflows/check-dist.yml +++ b/.github/workflows/check-dist.yml @@ -24,10 +24,10 @@ jobs: steps: - uses: actions/checkout@v4.1.6 - - name: Set Node.js 24.x + - name: Set Node.js 20.x uses: actions/setup-node@v4 with: - node-version: 24.x + node-version: 20.x - name: Install dependencies run: npm ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e62ac3b..cde9f06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-node@v4 with: - node-version: 24.x + node-version: 20.x - uses: actions/checkout@v4.1.6 - run: npm ci - run: npm run build diff --git a/.github/workflows/update-main-version.yml b/.github/workflows/update-main-version.yml index 643b954..7bec7d5 100644 --- a/.github/workflows/update-main-version.yml +++ b/.github/workflows/update-main-version.yml @@ -11,7 +11,6 @@ on: type: choice description: The major version to update options: - - v5 - v4 - v3 - v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index ff8b4e7..baf5c2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,5 @@ # Changelog -## V5.0.0 -* Update actions checkout to use node 24 by @salmanmkc in https://github.com/actions/checkout/pull/2226 - - ## V4.3.0 * docs: update README.md by @motss in https://github.com/actions/checkout/pull/1971 * Add internal repos for checking out multiple repositories by @mouismail in https://github.com/actions/checkout/pull/1977 diff --git a/README.md b/README.md index 9a32e9a..8969446 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,5 @@ [![Build and Test](https://github.com/actions/checkout/actions/workflows/test.yml/badge.svg)](https://github.com/actions/checkout/actions/workflows/test.yml) -# Checkout V5 - -## What's new - -- Updated to the node24 runtime - - This requires a minimum Actions Runner version of [v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) to run. - - # Checkout V4 This action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it. @@ -44,7 +36,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: # Repository name with owner. For example, actions/checkout # Default: ${{ github.repository }} @@ -157,33 +149,24 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ # Scenarios -- [Checkout V5](#checkout-v5) - - [What's new](#whats-new) -- [Checkout V4](#checkout-v4) - - [Note](#note) -- [What's new](#whats-new-1) -- [Usage](#usage) -- [Scenarios](#scenarios) - - [Fetch only the root files](#fetch-only-the-root-files) - - [Fetch only the root files and `.github` and `src` folder](#fetch-only-the-root-files-and-github-and-src-folder) - - [Fetch only a single file](#fetch-only-a-single-file) - - [Fetch all history for all tags and branches](#fetch-all-history-for-all-tags-and-branches) - - [Checkout a different branch](#checkout-a-different-branch) - - [Checkout HEAD^](#checkout-head) - - [Checkout multiple repos (side by side)](#checkout-multiple-repos-side-by-side) - - [Checkout multiple repos (nested)](#checkout-multiple-repos-nested) - - [Checkout multiple repos (private)](#checkout-multiple-repos-private) - - [Checkout pull request HEAD commit instead of merge commit](#checkout-pull-request-head-commit-instead-of-merge-commit) - - [Checkout pull request on closed event](#checkout-pull-request-on-closed-event) - - [Push a commit using the built-in token](#push-a-commit-using-the-built-in-token) - - [Push a commit to a PR using the built-in token](#push-a-commit-to-a-pr-using-the-built-in-token) -- [Recommended permissions](#recommended-permissions) -- [License](#license) +- [Fetch only the root files](#Fetch-only-the-root-files) +- [Fetch only the root files and `.github` and `src` folder](#Fetch-only-the-root-files-and-github-and-src-folder) +- [Fetch only a single file](#Fetch-only-a-single-file) +- [Fetch all history for all tags and branches](#Fetch-all-history-for-all-tags-and-branches) +- [Checkout a different branch](#Checkout-a-different-branch) +- [Checkout HEAD^](#Checkout-HEAD) +- [Checkout multiple repos (side by side)](#Checkout-multiple-repos-side-by-side) +- [Checkout multiple repos (nested)](#Checkout-multiple-repos-nested) +- [Checkout multiple repos (private)](#Checkout-multiple-repos-private) +- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit) +- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event) +- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token) +- [Push a commit to a PR using the built-in token](#Push-a-commit-to-a-PR-using-the-built-in-token) ## Fetch only the root files ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: sparse-checkout: . ``` @@ -191,7 +174,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ## Fetch only the root files and `.github` and `src` folder ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: sparse-checkout: | .github @@ -201,7 +184,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ## Fetch only a single file ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: sparse-checkout: | README.md @@ -211,7 +194,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ## Fetch all history for all tags and branches ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: fetch-depth: 0 ``` @@ -219,7 +202,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ## Checkout a different branch ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: ref: my-branch ``` @@ -227,7 +210,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ## Checkout HEAD^ ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: fetch-depth: 2 - run: git checkout HEAD^ @@ -237,12 +220,12 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ```yaml - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v4 with: path: main - name: Checkout tools repo - uses: actions/checkout@v5 + uses: actions/checkout@v4 with: repository: my-org/my-tools path: my-tools @@ -253,10 +236,10 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ```yaml - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v4 - name: Checkout tools repo - uses: actions/checkout@v5 + uses: actions/checkout@v4 with: repository: my-org/my-tools path: my-tools @@ -267,12 +250,12 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ```yaml - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v4 with: path: main - name: Checkout private tools - uses: actions/checkout@v5 + uses: actions/checkout@v4 with: repository: my-org/my-private-tools token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT @@ -285,7 +268,7 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/ ## Checkout pull request HEAD commit instead of merge commit ```yaml -- uses: actions/checkout@v5 +- uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} ``` @@ -301,7 +284,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v4 ``` ## Push a commit using the built-in token @@ -312,7 +295,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v4 - run: | date > generated.txt # Note: the following account information will not work on GHES @@ -334,7 +317,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - run: | diff --git a/action.yml b/action.yml index 767c416..6842eb8 100644 --- a/action.yml +++ b/action.yml @@ -104,6 +104,6 @@ outputs: commit: description: 'The commit SHA that was checked out' runs: - using: node24 + using: node20 main: dist/index.js post: dist/index.js diff --git a/package-lock.json b/package-lock.json index 98eb420..aef29d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "checkout", - "version": "5.0.0", + "version": "4.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "checkout", - "version": "5.0.0", + "version": "4.3.0", "license": "MIT", "dependencies": { "@actions/core": "^1.10.1", @@ -18,7 +18,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^24.1.0", + "@types/node": "^20.12.12", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^7.9.0", "@typescript-eslint/parser": "^7.9.0", @@ -1515,12 +1515,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", - "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "dependencies": { - "undici-types": "~7.8.0" + "undici-types": "~5.26.4" } }, "node_modules/@types/stack-utils": { @@ -6865,9 +6865,9 @@ } }, "node_modules/undici-types": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", - "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, "node_modules/universal-user-agent": { diff --git a/package.json b/package.json index 4b2b58a..dbbaabb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "checkout", - "version": "5.0.0", + "version": "4.3.0", "description": "checkout action", "main": "lib/main.js", "scripts": { @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^24.1.0", + "@types/node": "^20.12.12", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^7.9.0", "@typescript-eslint/parser": "^7.9.0", diff --git a/src/misc/generate-docs.ts b/src/misc/generate-docs.ts index 6d4816f..4b3c8ff 100644 --- a/src/misc/generate-docs.ts +++ b/src/misc/generate-docs.ts @@ -120,7 +120,7 @@ function updateUsage( } updateUsage( - 'actions/checkout@v5', + 'actions/checkout@v4', path.join(__dirname, '..', '..', 'action.yml'), path.join(__dirname, '..', '..', 'README.md') )