Skip to content

Fix race condition with actions/checkout@v1 - #428

Merged
simon-engledew merged 3 commits into
mainfrom
simon-engledew/detect-merge
Mar 23, 2021
Merged

Fix race condition with actions/checkout@v1#428
simon-engledew merged 3 commits into
mainfrom
simon-engledew/detect-merge

Conversation

@simon-engledew

@simon-engledewsimon-engledew commented Mar 22, 2021

Copy link
Copy Markdown

Work around a race condition in Actions where sometimes GITHUB_SHA != git rev-parse head after an actions/checkout@v1

image

This leads to the upload incorrectly rewriting the ref, causing analyses to go missing. 😭

Do not rewrite the ref when we:

  • are on GITHUB_SHA
  • are on GITHUB_REF

@simon-engledew
simon-engledewforce-pushed the simon-engledew/detect-merge branch 3 times, most recently from 69dbd1b to 4c8a765CompareMarch 22, 2021 11:40
@simon-engledewsimon-engledew changed the title Count the number of parents of the current commit to check it is still a mergeFix race condition with actions/checkout@v1 where GITHUB_SHA != git rev-parse HEADMar 22, 2021
@simon-engledewsimon-engledew changed the title Fix race condition with actions/checkout@v1 where GITHUB_SHA != git rev-parse HEADFix race condition with actions/checkout@v1Mar 22, 2021
@simon-engledew
simon-engledewforce-pushed the simon-engledew/detect-merge branch from 4c8a765 to b0ed899CompareMarch 22, 2021 12:01
…l a merge
Work around a race condition in actions where sometimes GITHUB_SHA != git rev-parse head
@simon-engledew
simon-engledewforce-pushed the simon-engledew/detect-merge branch from b0ed899 to ef92c5aCompareMarch 22, 2021 12:05
@simon-engledew
simon-engledew marked this pull request as ready for review March 22, 2021 12:43
Comment threadsrc/actions-util.ts Outdated
Comment threadsrc/actions-util.ts Outdated
Comment threadsrc/actions-util.ts
@simon-engledew
simon-engledew merged commit 972dc3e into mainMar 23, 2021
@simon-engledew
simon-engledew deleted the simon-engledew/detect-merge branch March 23, 2021 06:18
simon-engledew pushed a commit that referenced this pull request Mar 25, 2021
@simon-engledewsimon-engledew mentioned this pull request Mar 25, 2021
@github-actionsgithub-actionsBot mentioned this pull request Mar 26, 2021
aofaof0907 pushed a commit to aofaof0907/codeql-action that referenced this pull request Jul 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@simon-engledew@rneatherway