Compare commits

...

3 Commits

Author SHA1 Message Date
Josh Gross
eef61447b9 Prepare 4.2.1 release (#1925)
Some checks failed
Check dist / check-dist (push) Successful in 23s
Licensed / Check licenses (push) Successful in 20s
Build and Test / build (push) Failing after 31s
Build and Test / test-proxy (push) Failing after 22s
Build and Test / test-git-container (push) Failing after 11s
Build and Test / test (ubuntu-latest) (push) Failing after 50s
Build and Test / test-output (push) Successful in 14s
Build and Test / test-bypass-proxy (push) Failing after 50s
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Failing after 18s
2024-10-07 12:38:04 -04:00
Joel Ambass
6b42224f41 Add workflow file for publishing releases to immutable action package (#1919)
Some checks failed
Check dist / check-dist (push) Successful in 57s
CodeQL / Analyze (javascript) (push) Failing after 1m26s
Licensed / Check licenses (push) Successful in 20s
Build and Test / build (push) Failing after 30s
Build and Test / test (ubuntu-latest) (push) Failing after 44s
Build and Test / test-proxy (push) Failing after 33s
Build and Test / test-bypass-proxy (push) Failing after 33s
Build and Test / test-git-container (push) Failing after 16s
Build and Test / test-output (push) Successful in 14s
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
This workflow file publishes new action releases to the immutable action package of the same name as this repo.

This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
2024-10-03 11:03:35 +02:00
Orhan Toy
de5a000abf Check out other refs/* by commit if provided, fall back to ref (#1924)
Some checks failed
Check dist / check-dist (push) Successful in 22s
Licensed / Check licenses (push) Successful in 20s
CodeQL / Analyze (javascript) (push) Failing after 24s
Build and Test / build (push) Failing after 30s
Build and Test / test (ubuntu-latest) (push) Failing after 46s
Build and Test / test-proxy (push) Failing after 32s
Build and Test / test-git-container (push) Failing after 18s
Build and Test / test-bypass-proxy (push) Failing after 44s
Build and Test / test-output (push) Successful in 13s
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
2024-10-01 20:24:28 -04:00
7 changed files with 40 additions and 7 deletions

View File

@@ -0,0 +1,20 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@@ -1,5 +1,8 @@
# Changelog
## v4.2.1
* Check out other refs/* by commit if provided, fall back to ref by @orhantoy in https://github.com/actions/checkout/pull/1924
## v4.2.0
* Add Ref and Commit outputs by @lucacome in https://github.com/actions/checkout/pull/1180

View File

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

4
dist/index.js vendored
View File

@@ -2005,8 +2005,8 @@ function getCheckoutInfo(git, ref, commit) {
result.ref = ref;
}
// refs/
else if (upperRef.startsWith('REFS/') && commit) {
result.ref = commit;
else if (upperRef.startsWith('REFS/')) {
result.ref = commit ? commit : ref;
}
// Unqualified ref, check for a matching branch or tag
else {

4
package-lock.json generated
View File

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

View File

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

View File

@@ -46,8 +46,8 @@ export async function getCheckoutInfo(
result.ref = ref
}
// refs/
else if (upperRef.startsWith('REFS/') && commit) {
result.ref = commit
else if (upperRef.startsWith('REFS/')) {
result.ref = commit ? commit : ref
}
// Unqualified ref, check for a matching branch or tag
else {