Compare commits

..

1 Commits

11 changed files with 18 additions and 42 deletions

View File

@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v4

View File

@ -39,7 +39,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3

View File

@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4
- run: npm ci
- run: npm run licensed-check

View File

@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4
- run: npm ci
- run: npm run build
- run: npm run format-check
@ -37,7 +37,7 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4
# Basic checkout
- name: Checkout basic
@ -202,7 +202,7 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4
# Basic checkout using git
- name: Checkout basic
@ -234,7 +234,7 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4
# Basic checkout using git
- name: Checkout basic
@ -264,13 +264,13 @@ jobs:
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4
with:
path: localClone
path: v4
# Basic checkout using git
- name: Checkout basic
uses: ./localClone
uses: ./v4
with:
ref: test-data/v2/basic
- name: Verify basic
@ -292,6 +292,6 @@ jobs:
# needed to make checkout post cleanup succeed
- name: Fix Checkout v4
uses: actions/checkout@v4.1.6
uses: actions/checkout@v4
with:
path: localClone
path: v4

View File

@ -22,7 +22,7 @@ jobs:
# Note this update workflow can also be used as a rollback tool.
# For that reason, it's best to pin `actions/checkout` to a known, stable version
# (typically, about two releases back).
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git config

View File

@ -1,11 +1,5 @@
# Changelog
## v4.1.7
* Bump the minor-npm-dependencies group across 1 directory with 4 updates by @dependabot in https://github.com/actions/checkout/pull/1739
* Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/actions/checkout/pull/1697
* Check out other refs/* by commit by @orhantoy in https://github.com/actions/checkout/pull/1774
* Pin actions/checkout's own workflows to a known, good, stable version. by @jww3 in https://github.com/actions/checkout/pull/1776
## v4.1.6
* Check platform to set archive extension appropriately by @cory-miller in https://github.com/actions/checkout/pull/1732

View File

@ -67,16 +67,6 @@ describe('ref-helper tests', () => {
expect(checkoutInfo.startPoint).toBeFalsy()
})
it('getCheckoutInfo refs/', async () => {
const checkoutInfo = await refHelper.getCheckoutInfo(
git,
'refs/gh/queue/main/pr-123',
commit
)
expect(checkoutInfo.ref).toBe(commit)
expect(checkoutInfo.startPoint).toBeFalsy()
})
it('getCheckoutInfo unqualified branch only', async () => {
git.branchExists = jest.fn(async (remote: boolean, pattern: string) => {
return true

6
dist/index.js vendored
View File

@ -2000,13 +2000,9 @@ function getCheckoutInfo(git, ref, commit) {
result.ref = `refs/remotes/pull/${branch}`;
}
// refs/tags/
else if (upperRef.startsWith('REFS/TAGS/')) {
else if (upperRef.startsWith('REFS/')) {
result.ref = ref;
}
// refs/
else if (upperRef.startsWith('REFS/') && commit) {
result.ref = commit;
}
// Unqualified ref, check for a matching branch or tag
else {
if (yield git.branchExists(true, `origin/${ref}`)) {

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "checkout",
"version": "4.1.7",
"version": "4.1.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "checkout",
"version": "4.1.7",
"version": "4.1.6",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1",

View File

@ -1,6 +1,6 @@
{
"name": "checkout",
"version": "4.1.7",
"version": "4.1.6",
"description": "checkout action",
"main": "lib/main.js",
"scripts": {

View File

@ -42,13 +42,9 @@ export async function getCheckoutInfo(
result.ref = `refs/remotes/pull/${branch}`
}
// refs/tags/
else if (upperRef.startsWith('REFS/TAGS/')) {
else if (upperRef.startsWith('REFS/')) {
result.ref = ref
}
// refs/
else if (upperRef.startsWith('REFS/') && commit) {
result.ref = commit
}
// Unqualified ref, check for a matching branch or tag
else {
if (await git.branchExists(true, `origin/${ref}`)) {