Skip to content

Commit

Permalink
remove deprecated crypto package (#111)
Browse files Browse the repository at this point in the history
* remove deprecated crypto package

* default empty return

* format
  • Loading branch information
davidgamero authored Feb 9, 2024
1 parent fefe3c0 commit ebc9c6e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
14 changes: 1 addition & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.0",
"@actions/io": "^1.1.1",
"crypto": "^1.0.1"
"@actions/io": "^1.1.1"
},
"devDependencies": {
"@types/jest": "^25.2.2",
Expand Down
1 change: 1 addition & 0 deletions src/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('Set context', () => {
.mockImplementation((inputName, options) => {
if (inputName == 'resource-group') return resourceGroup
if (inputName == 'cluster-name') return ''
return ''
})
await expect(run()).rejects.toThrow()
},
Expand Down
4 changes: 2 additions & 2 deletions src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as io from '@actions/io'
import * as exec from '@actions/exec'
import * as path from 'path'
import * as fs from 'fs'
import * as crypto from 'crypto'
import {createHash} from 'crypto'

const AZ_TOOL_NAME = 'az'
const KUBELOGIN_TOOL_NAME = 'kubelogin'
Expand Down Expand Up @@ -97,7 +97,7 @@ export async function run() {
function getUserAgent(prevUserAgent: string): string {
const actionName = process.env.GITHUB_ACTION_REPOSITORY || ACTION_NAME
const runRepo = process.env.GITHUB_REPOSITORY || ''
const runRepoHash = crypto.createHash('sha256').update(runRepo).digest('hex')
const runRepoHash = createHash('sha256').update(runRepo).digest('hex')
const runId = process.env.GITHUB_RUN_ID
const newUserAgent = `GitHubActions/${actionName}(${runRepoHash}; ${runId})`

Expand Down

0 comments on commit ebc9c6e

Please sign in to comment.