File tree Expand file tree Collapse file tree 3 files changed +34
-50
lines changed
Expand file tree Collapse file tree 3 files changed +34
-50
lines changed Original file line number Diff line number Diff line change 1+ # fetch_latest_iso.sh
2+ # D.A.Pelasgus
3+
4+ name: Fetch Latest ISO Download Link
5+
6+ on:
7+ push:
8+ branches:
9+ - main
10+ workflow_dispatch:
11+
12+ jobs:
13+ fetch-latest-iso:
14+ runs-on: ubuntu-latest
15+
16+ steps:
17+ - name: Checkout repository
18+ uses: actions/checkout@v2
19+
20+ - name: Make fetch_latest_iso.sh executable
21+ run: chmod +x fetch_latest_iso.sh
22+
23+ - name: Run shell script to fetch ISO download link
24+ env:
25+ REPO: " chimeraos/install-media"
26+ OUTPUT_FILE: " output/latest_iso_url.txt"
27+ run: ./fetch_latest_iso.sh
28+
29+ - name: Load download link into environment
30+ run: echo " DOWNLOAD_LINK=$( cat .iso_download.env | grep ISO_URL | cut -d ' =' -f2) " >> $GITHUB_ENV
31+
32+ - name: Insert download link into Mustache file
33+ run: sed -i " s|{{downloadLink}}|$DOWNLOAD_LINK |g" path/to/your_template.mustache
34+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 5757 </div >
5858 </a >
5959</div >
60-
61- <!-- JavaScript function to set the download link -->
62- <script >
63- async function setDownloadLink () {
64- try {
65- const response = await fetch (" https://api.github.com/repos/chimeraos/install-media/releases/latest" );
66- const data = await response.json();
67- const isoAsset = data.assets.find(asset => asset.name.endsWith(' .iso' ));
68-
69- if (isoAsset) {
70- const downloadLink = document.getElementById(" downloadLink" );
71- downloadLink.href = isoAsset.browser_download_url;
72- downloadLink.download = isoAsset.name;
73- } else {
74- console.error(" ISO file not found in the latest release." );
75- }
76- } catch (error) {
77- console.error(" Error fetching the latest release:" , error);
78- }
79- }
80-
81- setDownloadLink ();
82- </script >
83-
8460{ {> footer} }
You can’t perform that action at this time.
0 commit comments