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(deps): lock file maintenance #1224

Merged
merged 5 commits into from
Jun 5, 2023
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
14 changes: 9 additions & 5 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/commitSha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const getSHAForPullRequestEvent = async (
core.info('Completed fetching more history.')
}

const currentSha = await getCurrentSHA({inputs, workingDirectory})
let currentSha = await getCurrentSHA({inputs, workingDirectory})
let previousSha = inputs.baseSha
let diff = '...'

Expand Down Expand Up @@ -425,6 +425,10 @@ export const getSHAForPullRequestEvent = async (
}
}

if (previousSha === currentSha && env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA) {
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
}

if (
!(await canDiffCommits({
cwd: workingDirectory,
Expand Down
3 changes: 3 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ export type Env = {
GITHUB_EVENT_FORCED: string
GITHUB_EVENT_PULL_REQUEST_NUMBER: string
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: string
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: string
}

type GithubEvent = {
forced?: string
pull_request?: {
head: {
ref: string
sha: string
}
base: {
ref: string
Expand Down Expand Up @@ -58,6 +60,7 @@ export const getEnv = async (): Promise<Env> => {
GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head_repo?.fork || '',
GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '',
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '',
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: eventJson.pull_request?.head?.sha || '',
GITHUB_EVENT_FORCED: eventJson.forced || '',
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
GITHUB_REF: process.env.GITHUB_REF || '',
Expand Down
6 changes: 3 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export const getSubmodulePath = async ({
return stdout
.trim()
.split('\n')
.map(line => normalizePath(line.split(' ')[1]))
.map((line: string) => normalizePath(line.split(' ')[1]))
}

export const gitSubmoduleDiffSHA = async ({
Expand Down Expand Up @@ -389,7 +389,7 @@ export const gitRenamedFiles = async ({
.trim()
.split('\n')
.filter(Boolean)
.map(line => {
.map((line: string) => {
core.debug(`Renamed file: ${line}`)
const [, oldPath, newPath] = line.split('\t')
if (isSubmodule) {
Expand Down Expand Up @@ -459,7 +459,7 @@ export const gitDiff = async ({
const files = stdout
.split('\n')
.filter(Boolean)
.map(p => {
.map((p: string) => {
if (isSubmodule) {
return normalizePath(path.join(parentDir, p))
}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001489:
version "1.0.30001492"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001492.tgz#4a06861788a52b4c81fd3344573b68cc87fe062b"
integrity sha512-2efF8SAZwgAX1FJr87KWhvuJxnGJKOnctQa8xLOskAXNXq8oiuqgl6u1kk3fFpsp3GgvzlRjiK1sl63hNtFADw==
version "1.0.30001494"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001494.tgz#3e56e04a48da7a79eae994559eb1ec02aaac862f"
integrity sha512-sY2B5Qyl46ZzfYDegrl8GBCzdawSLT4ThM9b9F+aDYUrAG2zCOyMbd2Tq34mS1g4ZKBfjRlzOohQMxx28x6wJg==

chalk@^2.0.0:
version "2.4.2"
Expand Down
Loading