Skip to content

Commit

Permalink
Merge pull request wildfly#18168 from kabir/update-dependency-tree-ch…
Browse files Browse the repository at this point in the history
…ecker

Include hidden files when uploading the artifact; use action to download
  • Loading branch information
kabir authored Sep 4, 2024
2 parents 40236f3 + 3bad147 commit ac7bdc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dep-diff-pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,5 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: input-artifacts
path: ${{ steps.prepare.outputs.artifacts }}
path: ${{ steps.prepare.outputs.artifacts }}
include-hidden-files: true
29 changes: 4 additions & 25 deletions .github/workflows/dep-diff-workflow_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,15 @@ jobs:
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download artifacts
# It would have been nice to be able to use actions/download-artifact@v2
# for this, but as the artifacts are uploaded by another workflow it does
# not seem possible - so we need to do this stuff instead
uses: actions/github-script@v7.0.1
- uses: actions/download-artifact@v4
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
console.log(artifacts);
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "input-artifacts"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/input.zip', Buffer.from(download.data));
name: input-artifacts
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- name: Set needed env vars in outputs
id: prepare
run: |
unzip input.zip
echo current directory contents
ls -al
echo "deps_ok_label_name=${DEPS_OK_LABEL_NAME}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit ac7bdc6

Please sign in to comment.