Skip to content

Commit

Permalink
Revert "Add fallbackToDownoadAction (#192)"
Browse files Browse the repository at this point in the history
This reverts commit 2ccc909.
  • Loading branch information
dawidd6 committed Oct 3, 2022
1 parent 2ccc909 commit 2eb1f25
Show file tree
Hide file tree
Showing 226 changed files with 851 additions and 15,876 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ jobs:
steps:
- name: Wait
run: sleep 60
in-progress:
runs-on: ubuntu-latest
steps:
- name: Dump
run: |
mkdir artifact
echo temp > artifact/sha
- name: Upload a temporary artifact
uses: actions/upload-artifact@v3
with:
name: artifact
path: artifact
download-latest:
runs-on: ubuntu-latest
needs: wait
Expand Down Expand Up @@ -152,34 +140,4 @@ jobs:
dry_run: true
- name: Test
run: test ${{ steps.download.outputs.dry_run }} == false
download-in-progress:
runs-on: ubuntu-latest
needs: [wait, in-progress]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download
uses: ./
with:
workflow: upload.yml
name: artifact
path: artifact
workflow_conclusion: in_progress
- name: Test
run: grep temp artifact/sha
download-empty-conclusion:
runs-on: ubuntu-latest
needs: [wait, in-progress]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download
uses: ./
with:
workflow: upload.yml
name: artifact
path: artifact
workflow_conclusion:
- name: Test
run: grep $GITHUB_SHA artifact/sha

24 changes: 1 addition & 23 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
const core = require('@actions/core')
const github = require('@actions/github')
const artifact = require('@actions/artifact')
const AdmZip = require('adm-zip')
const filesize = require('filesize')
const pathname = require('path')
const fs = require('fs')

async function downloadAction(name, path) {
const artifactClient = artifact.create()
const downloadOptions = {
createArtifactFolder: false
}
const downloadResponse = await artifactClient.downloadArtifact(
name,
path,
downloadOptions
)
core.setOutput("found_artifact", true)
}

async function main() {
try {
const token = core.getInput("github_token", { required: true })
Expand Down Expand Up @@ -151,15 +137,7 @@ async function main() {
}

if (!runID) {
if (workflowConclusion && (workflowConclusion != 'in_progress')) {
return setExitMessage(ifNoArtifactFound, "no matching workflow run found with any artifacts?")
}

try {
return await downloadAction(name, path)
} catch (error) {
return setExitMessage(ifNoArtifactFound, "no matching artifact in this workflow?")
}
return setExitMessage(ifNoArtifactFound, "no matching workflow run found with any artifacts?")
}

let artifacts = await client.paginate(client.rest.actions.listWorkflowRunArtifacts, {
Expand Down
151 changes: 7 additions & 144 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions node_modules/@actions/artifact/LICENSE.md

This file was deleted.

Loading

0 comments on commit 2eb1f25

Please sign in to comment.