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

Revert "Upgrade Artifact actions v4" #6917

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

KyleJu
Copy link
Contributor

@KyleJu KyleJu commented Nov 8, 2024

@KyleJu KyleJu added the do not merge yet Disable auto-merge label Nov 8, 2024
@KyleJu KyleJu requested review from a team as code owners November 8, 2024 00:59
@KyleJu KyleJu enabled auto-merge (squash) November 8, 2024 01:13
@KyleJu KyleJu disabled auto-merge November 8, 2024 01:14
Copy link

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

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

I know nothing, but if you need a stamp, here's one :)

Copy link
Collaborator

@jcscottiii jcscottiii left a comment

Choose a reason for hiding this comment

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

@KyleJu,

Given that we will have to solve this problem again when we switch this back to v4, I have an idea that you may want to try.

The failure you linked showed that it failed to download the artifact.
Looking at the release notes for the upload-artifact action, I see the following text:

Artifacts created with versions v3 and below are not compatible with the v4 actions. Uploads and downloads must use the same major actions versions.

I wonder if we should instead take a look at the download logic that looks to be outdated:

uses: actions/github-script@v3.1.0
with:
script: |
console.log("Starting to list artifacts");
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
console.log("Filtering artifacts");
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr_number"
})[0];
console.log("Downloading artifacts");
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
console.log("Writing artifacts to disk");
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));

It is using actions/github-script@v3.1.0, which I suspect is using artifact API v1 vs artifact API v2. (not 100% sure though).

Could you instead create a separate PR that adjusts auto-approve.yml to use actions/github-script@v7?

You can see an example of another repository doing it: https://github.com/platisd/clang-tidy-pr-comments/blob/88780c4ca5471b97de8f228219d1e39b1a472142/README.md?plain=1#L265-L283

@KyleJu KyleJu mentioned this pull request Nov 8, 2024
@KyleJu KyleJu merged commit 5b2deef into master Nov 8, 2024
2 checks passed
@KyleJu KyleJu deleted the revert-6910-KyleJu-patch-1 branch November 8, 2024 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge yet Disable auto-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants