Skip to content

Conversation

@lakkeger
Copy link
Contributor

@lakkeger lakkeger commented Jun 12, 2024

Motivation

Finish comment sometimes not updated by the new action, instead it's picking up the previous PR comment.
It seems the source of the issue is the download action dawidd6/action-download-artifact@v2 which only picks up successfully concluded workflows by default. As a result the currently running pipeline is not among these instead it's picking the latest successful run on the workflow which can be a different PR.
By adding 2 download actions we try to download the artifact first from the current pipeline, if that's not successful we try to download an artifact from the latest successful PR pipeline, if this fails we fail.
Additionally we provide an env variable to override the workflow we're looking for the artifact, however this must be part of the PR.

Changes

  • add action/artifact-download to handle current pipeline artifacts
  • add v6 version of the old action to be able to search PRs properly
  • allow overriding with env variables for workflow PR_ARTIFACT_WORKFLOW
  • small fix on shutdown action's comment
  • apply this download method on local state management

@github-actions
Copy link

github-actions bot commented Jun 12, 2024

The ephemeral instance for the application preview has been shut down

@lakkeger lakkeger force-pushed the fix_finish_comment branch 3 times, most recently from 0a342b9 to 0b429c7 Compare June 13, 2024 07:37
@lakkeger lakkeger force-pushed the fix_finish_comment branch from 0b429c7 to 530672a Compare June 13, 2024 07:44
@lakkeger lakkeger changed the title Fix finish comment Fix download actions Jun 13, 2024
@lakkeger lakkeger force-pushed the fix_finish_comment branch 2 times, most recently from 199571f to 2d6b15d Compare June 13, 2024 10:19
@lakkeger lakkeger force-pushed the fix_finish_comment branch from 2d6b15d to 28553e3 Compare June 13, 2024 10:24
@lakkeger lakkeger marked this pull request as ready for review June 13, 2024 10:39
@lakkeger lakkeger requested a review from whummer June 13, 2024 10:39
Copy link
Member

@whummer whummer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @lakkeger - great to see the progress on this action, to cover the different edge cases..! 🚀

@lakkeger lakkeger merged commit e6a1e5c into main Jun 16, 2024
@lakkeger lakkeger linked an issue Jun 17, 2024 that may be closed by this pull request
Sign up for free to 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.

Finish comment is added on wrong PR

4 participants