fix: sanitize artifact name for refs with slashes

map any char outside [A-Za-z0-9._-] to '-' so branch names like
feature/foo don't break artifact upload
This commit is contained in:
chaos-zhu
2026-06-07 12:38:21 +08:00
parent e8e5aa10c9
commit 32cb71c062
+10 -1
View File
@@ -102,10 +102,19 @@ jobs:
exit 1
fi
- name: Compute artifact name
id: meta
shell: bash
run: |
REF="${{ github.event.inputs.ref || github.ref_name }}"
# artifact 名不允许 / : < > | * ? \ 等字符,统一替换为 -
SAFE=$(printf '%s' "$REF" | tr -c 'A-Za-z0-9._-' '-')
echo "artifact=easynode-native-android-${SAFE}" >> "$GITHUB_OUTPUT"
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: easynode-native-android-${{ github.event.inputs.ref || github.ref_name }}
name: ${{ steps.meta.outputs.artifact }}
path: |
native/build/app/outputs/flutter-apk/*.apk