@@ -30,27 +30,27 @@ jobs:
30
30
repo_owner="rhunk"
31
31
repo_name="SnapEnhance"
32
32
workflow_name="beta.yml"
33
- pat="${{ secrets.SNAPENHANCEWORKFLOWARTIFACT }}"
33
+ pat="${{ secrets.SNAP_ENHANCE_WORKFLOW_ARTIFACT }}"
34
34
35
- # Fetching the latest run for the specified workflow
36
- run_url=$(curl -s -H "Authorization: Bearer $pat" \
35
+ artifact_url=$(curl -s -H "Authorization: Bearer $pat" \
37
36
"https://api.github.com/repos/${repo_owner}/${repo_name}/actions/workflows/${workflow_name}/runs?status=success&per_page=1" \
38
- | jq -r '.workflow_runs[0].url ')
37
+ | jq -r '.workflow_runs[0].artifacts_url ')
39
38
40
- # Fetching the artifact ID from the latest run
41
- artifact_id=$(curl -s -H "Authorization: Bearer $pat" \
42
- "$run_url/artifacts" \
43
- | jq -r '.artifacts[0].id')
39
+ download_url=$(curl -s -H "Authorization: Bearer $pat" \
40
+ "$artifact_url" \
41
+ | jq -r '.artifacts[0].archive_download_url')
44
42
45
- # Downloading the artifact using curl
46
- curl -u ${{ secrets.GITHUB_TOKEN }} \
47
- -L -o core.zip \
48
- "https://api.github.com/repos/${repo_owner}/${repo_name}/actions/artifacts/${artifact_id}/zip"
43
+ echo "Artifact URL: $artifact_url"
44
+ echo "Download URL: $download_url"
49
45
50
- # Unzipping the artifact
51
- unzip -q core.zip -d artifact
46
+ echo "download_url=$download_url" >> $GITHUB_ENV
52
47
shell : bash
53
48
49
+ - name : Download Latest core.apk
50
+ run : |
51
+ download_url="${{ env.download_url }}"
52
+ wget "$download_url" -O "$GITHUB_WORKSPACE/core.apk"
53
+
54
54
- name : Run the command
55
55
run : |
56
56
java -jar lspatch.jar -m artifact/core.apk -f -l 2 -v snap.apk
0 commit comments