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

chore: update @actions/artifact #65

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The GitHub token used to authenticate API requests. You can use the `{{ secrets.
This is the key in which we mention the workflow name and pattern that we want to match which are seperated by `,`.

### `UPLOAD_KEY` (required)
This is required when you want to update on successfull run of a job.
This is required when you want to update the successful run of a job.

### `DISABLE_CHECK`
This is used if you want to disable check then all the keys that are provided will have shouldRun as `true`.
Expand Down
65,165 changes: 0 additions & 65,165 deletions dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/index.js.map

This file was deleted.

1,919 changes: 0 additions & 1,919 deletions dist/licenses.txt

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "saurav0705",
"license": "MIT",
"dependencies": {
"@actions/artifact": "^1.1.1",
"@actions/artifact": "^2.1.1",
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@actions/exec": "^1.1.1",
Expand All @@ -39,7 +39,7 @@
"@types/adm-zip": "^0.5.0",
"@types/node": "^18.16.3",
"@types/picomatch": "^2.3.0",
"@typescript-eslint/parser": "^5.59.2",
"@typescript-eslint/parser": "^7.0.0",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.39.0",
"eslint-plugin-github": "^4.7.0",
Expand Down
8 changes: 2 additions & 6 deletions src/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ArtifactClient, create} from '@actions/artifact'
import {DefaultArtifactClient} from '@actions/artifact'
import {
arrayBufferToFile,
convertFileToString,
Expand All @@ -13,13 +13,9 @@ import {
import {github} from './github/client'

class ArtifactHandler {
client = create()
client = new DefaultArtifactClient()
retentionDays = 30

setClient(client: ArtifactClient): void {
this.client = client
}

setRetentionDays(days: number): void {
this.retentionDays = days
}
Expand Down
8 changes: 4 additions & 4 deletions src/github/get-diff-from-commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ export const getFileDiffFromGithub = async ({
}
)

if (!diff.exitCode || !base.exitCode || !head.exitCode) {
if (diff.exitCode || base.exitCode || head.exitCode) {
const errors: string[] = []

if(!diff.exitCode){
if(diff.exitCode){
errors.push( `Failed to get diff files between ${base}..${head} Exit code: ${diff.exitCode}. Due to error ${diff.stderr}`)
}

if(!base.exitCode){
if(base.exitCode){
errors.push( `Failed to fetch base: ${base} commit Exit code: ${base.exitCode}. Due to error ${base.stderr}`)
}

if(!head.exitCode){
if(head.exitCode){
errors.push( `Failed to fetch head: ${head} commit Exit code: ${head.exitCode}. Due to error ${head.stderr}`)
}

Expand Down
2 changes: 1 addition & 1 deletion src/post-comment-on-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const makeSummaryForItem = (item: ArtifactFinalResponseStatus): string => {
<summary><h3>${item.suppliedKey}<code>${
item.shouldRun
}</code></h3></summary>\n
- Last Successfull Run Commit: [${item.sha}](${generateCommitRunUrl(
- Last Successfully Run Commit: [${item.sha}](${generateCommitRunUrl(
item.sha
)})\n
- Pattern: \`${item.filesRegex}\`\n
Expand Down
Loading