update #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Individual Artifacts | |
on: | |
push: | |
branches: | |
- fix/* | |
jobs: | |
upload-artifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Prepare files | |
# Simulate creating or gathering .tar.gz files in the archive folder | |
run: | | |
mkdir -p archive | |
touch archive/file1.tar.gz archive/file2.tar.gz | |
echo "File 1" > archive/file1.tar.gz | |
echo "File 2" > archive/file2.tar.gz | |
- name: Trigger upload workflow for each file | |
env: | |
GH_TOKEN: ${{ github.token }} # Set GH_TOKEN environment variable | |
run: | | |
for file in archive/*.tar.gz; do | |
artifact_name=$(basename "$file" .tar.gz) | |
echo "Triggering upload for $file as $artifact_name" | |
# Use gh workflow run with --field | |
gh workflow run upload_artifacts.yml \ | |
--ref ${{ github.ref_name }} \ | |
-f artifact_name="$artifact_name" \ | |
-f artifact_path="$file" | |
done |