Skip to content

Commit

Permalink
[GHA] Don't update latest available artifacts link when copy failed (o…
Browse files Browse the repository at this point in the history
…penvinotoolkit#26929)

This will make sure that "latest available" link is pointing to the
complete set of artifacts
  • Loading branch information
akladiev authored Oct 7, 2024
1 parent 2c6d1bb commit 2167b03
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/actions/store_artifacts/store_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ def main():
with open(storage / 'workflow_link.txt', 'w') as file:
file.write(workflow_link)

latest_artifacts_for_branch = artifact_utils.get_latest_artifacts_link(storage_dir, args.storage_root,
args.branch_name, args.event_name)
# Overwrite path to "latest" built artifacts only if a given commit is the head of a given branch
if args.event_name != 'pull_request' and args.commit_sha == os.getenv('GITHUB_SHA'):
# TODO: lock to avoid corruption in case of a parallel build (unlikely event for now, but still)
with open(latest_artifacts_for_branch, 'w') as file:
file.write(str(storage.relative_to(storage_root)))
if not error_found:
latest_artifacts_for_branch = artifact_utils.get_latest_artifacts_link(storage_dir, args.storage_root,
args.branch_name, args.event_name)
# Overwrite path to "latest" built artifacts only if a given commit is the head of a given branch
if args.event_name != 'pull_request' and args.commit_sha == os.getenv('GITHUB_SHA'):
# TODO: lock to avoid corruption in case of a parallel build (unlikely event for now, but still)
with open(latest_artifacts_for_branch, 'w') as file:
file.write(str(storage.relative_to(storage_root)))

logger.debug(f"Copying finished")
(storage / 'copying_finished').touch()
Expand Down

0 comments on commit 2167b03

Please sign in to comment.