Skip to content

Update and fix gh actions #6651

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

Closed
wants to merge 3 commits into from
Closed
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
3 changes: 2 additions & 1 deletion .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
name: bundle_analysis.json

- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
Copy link
Member

Choose a reason for hiding this comment

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

do we really need an external action for this? could we rewrite this to use https://github.com/actions/toolkit/tree/main/packages/artifact instead?

Copy link
Contributor Author

@alinkedd alinkedd Nov 8, 2024

Choose a reason for hiding this comment

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

Sorry for the delayed response

From what I understand, previous versions of actions/download-artifact didn't support retrieving an artifact from a different workflow, but dawidd6/action-download-artifact enabled this via a REST API for downloading.

It now looks like actions/download-artifact@v4 officially supports this feature, so it should be easier to implement that using only the official package.

I'll try to work on this over the weekend


UPD actions/download-artifact#3 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@poteto I've completely forgot about this one :) I've moved the fixes to #7667 since they're small and ready to go.

However, I'm not available to work on the improvement of switching from dawidd6/action-download-artifact to the latest version of actions/download-artifact, perhaps it could be converted into a separate issue

if: success() && github.event.number
with:
workflow: analyze.yml
Expand All @@ -82,6 +82,7 @@ jobs:

- name: Upload analysis comment
uses: actions/upload-artifact@v4
if: success() && github.event.number
with:
name: analysis_comment.txt
path: .next/analyze/__bundle_analysis_comment.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/analyze_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
comment:
runs-on: ubuntu-latest
if: >
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Download base branch bundle stats
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: analyze.yml
run_id: ${{ github.event.workflow_run.id }}
name: analysis_comment.txt
path: analysis_comment.txt

- name: Download PR number
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: analyze.yml
run_id: ${{ github.event.workflow_run.id }}
Expand Down