Skip to content

Commit 0cfab75

Browse files
committed
Download artifacts from ResInsight
1 parent 4c7ee48 commit 0cfab75

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Download rips and Python examples from main ResInsight repository
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 6 * * *' # Daily at 6 AM
7+
8+
jobs:
9+
download-latest:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get latest successful run
13+
id: get-run
14+
uses: actions/github-script@v7
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
script: |
18+
const { data: runs } = await github.rest.actions.listWorkflowRuns({
19+
owner: 'OPM',
20+
repo: 'ResInsight',
21+
workflow_id: 'ResInsightWithCache.yml', # or workflow filename
22+
status: 'success',
23+
per_page: 1
24+
});
25+
26+
if (runs.total_count === 0) {
27+
core.setFailed('No successful runs found');
28+
return;
29+
}
30+
31+
core.setOutput('run-id', runs[0].id);
32+
core.setOutput('run-url', runs[0].html_url);
33+
34+
- name: Download artifacts
35+
uses: actions/download-artifact@v4
36+
with:
37+
name: build-artifacts # Name of the artifact
38+
repository: target-owner/target-repo
39+
run-id: ${{ steps.get-run.outputs.run-id }}
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
path: ./downloaded-artifacts
42+
43+
- name: List downloaded files
44+
run: |
45+
echo "Downloaded files:"
46+
ls -la ./downloaded-artifacts/

0 commit comments

Comments
 (0)