Skip to content

Commit 51ef5aa

Browse files
committed
update main.yml
1 parent 239848a commit 51ef5aa

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ jobs:
3030
repo_owner="rhunk"
3131
repo_name="SnapEnhance"
3232
workflow_name="beta.yml"
33-
pat="${{ secrets.SNAPENHANCEWORKFLOWARTIFACT }}"
33+
pat="${{ secrets.SNAP_ENHANCE_WORKFLOW_ARTIFACT }}"
3434
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" \
3736
"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')
3938
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')
4442
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"
4945
50-
# Unzipping the artifact
51-
unzip -q core.zip -d artifact
46+
echo "download_url=$download_url" >> $GITHUB_ENV
5247
shell: bash
5348

49+
- name: Download Latest core.apk
50+
run: |
51+
download_url="${{ env.download_url }}"
52+
wget "$download_url" -O "$GITHUB_WORKSPACE/core.apk"
53+
5454
- name: Run the command
5555
run: |
5656
java -jar lspatch.jar -m artifact/core.apk -f -l 2 -v snap.apk

0 commit comments

Comments
 (0)