Skip to content

Commit b23b2c5

Browse files
committed
Add fallback-to-previous-compatible option (default true, like previous behavior)
1 parent 92ca896 commit b23b2c5

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.github/workflows/build-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
with:
7474
edition: fasm1
7575
version: ${{ matrix.version }}
76+
fallback-to-previous-compatible: false
7677
- name: Check installed version
7778
run: |
7879
(fasm.x64 || fasm || fasm.o || FASM.EXE) 2>/dev/null || true
@@ -106,6 +107,7 @@ jobs:
106107
uses: ./
107108
with:
108109
edition: fasmg
110+
fallback-to-previous-compatible: false
109111
fasmg-download-packages: true
110112
fasmg-include-packages: utility, x86
111113
- name: Check installed version
@@ -146,6 +148,7 @@ jobs:
146148
uses: ./
147149
with:
148150
edition: fasmarm
151+
fallback-to-previous-compatible: false
149152
- name: Check installed version
150153
run: |
151154
(fasmarm.x64 || fasmarm || fasmarm.o || FASMARM.EXE) 2>/dev/null || true

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
description: Version of edition to install; e.g. 1.73.30, 1.73.*, or latest
1212
required: false
1313
default: latest
14+
fallback-to-previous-compatible:
15+
description: Fallback to previous compatible version instead of the newest compatible when errors with downloading occur
16+
required: false
17+
default: 'true'
1418
ignore-official-https-hash-mismatch:
1519
description: Ignore file hash mismatches for files download from https://flatassembler.net
1620
required: false

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-fasm",
3-
"version": "1.2.2",
3+
"version": "1.3.0",
44
"private": true,
55
"author": "stevenwdv",
66
"license": "MIT",

src/setup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const fasmgRepoUrl = new URL('https://github.com/tgrysztar/fasmg.git');
2020
async function main() {
2121
const requestedEdition: FasmEditionStr | string = core.getInput('edition').toLowerCase(),
2222
requestedVersion: 'latest' | string = core.getInput('version').toLowerCase(),
23+
fallbackToPreviousCompatible = core.getBooleanInput('fallback-to-previous-compatible'),
2324
ignoreOfficialHttpsHashMismatch = core.getBooleanInput('ignore-official-https-hash-mismatch'),
2425
downloadUnknown: 'never' | 'secure' | string | 'insecure' = core.getInput('download-unknown').toLowerCase(),
2526
customVersionList = core.getInput('custom-version-list'),
@@ -103,7 +104,7 @@ async function main() {
103104
return;
104105
}
105106

106-
if (!--triesLeft) {
107+
if (!fallbackToPreviousCompatible || !--triesLeft) {
107108
core.setFailed('maximum number of versions to try exceeded');
108109
return;
109110
}

0 commit comments

Comments
 (0)