Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for artifacts uploaded by actions/upload-artifact@v4 #1791

Merged
merged 10 commits into from
Mar 9, 2024
4 changes: 4 additions & 0 deletions src/test/java/org/kohsuke/github/GHWorkflowRunTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ public void testLogs() throws IOException {
@SuppressWarnings("resource")
@Test
public void testArtifacts() throws IOException {
// Recorded with Authorization, then manually updated
snapshotNotAllowed();

mockGitHub.customizeRecordSpec(recordSpecBuilder -> recordSpecBuilder.captureHeader("Authorization"));
GHWorkflow workflow = repo.getWorkflow(ARTIFACTS_WORKFLOW_PATH);

long latestPreexistingWorkflowRunId = getLatestPreexistingWorkflowRunId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ void renameFiles() throws IOException {
if (!filePath.equals(renamedFilePath)) {
Files.move(filePath, renamedFilePath);
}
if (bodyPath != null && !bodyPath.equals(renamedFilePath)) {
Files.move(filePath, renamedFilePath);
if (bodyPath != null && !bodyPath.equals(renamedBodyPath)) {
Files.move(bodyPath, renamedBodyPath);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
},
"bodyPatterns": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"equalTo": "Basic cGxhY2Vob2xkZXItdXNlcjpwbGFjZWhvbGRlci1wYXNzd29yZA=="
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"absent" : true
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"headers": {
"Accept": {
"equalTo": "application/vnd.github.v3+json"
},
"Authorization": {
"absent" : true
Copy link
Member

@bitwiseman bitwiseman Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsmet Verified that the header is removed for the redirected requests!

}
}
},
Expand Down