Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pitag-ha committed Dec 17, 2023
1 parent 442c3d2 commit fce07e2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/workflow_triggered_by_workflow_run.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Execute privileged instructions`
name: Execute privileged instructions

env:
GH_API_ARTIFACTS: https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts
GH_API_ACTIONS: https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts

on:
workflow_run:
Expand All @@ -19,31 +19,31 @@ jobs:
echo "${{ toJson(github.event.workflow_run) }}"
- name: Download artifact
run: |
all_artifacts=$(curl -sSL "$GH_API_ARTIFACTS")
all_artifacts=$(curl -sSL "$GH_API_ACTIONS/runs/${{ github.event.workflow_run.id }}/artifacts")
forward_artifact=$(echo $all_artifacts | jq '.artifacts[] | select(.workflow_run.id == ${{ github.event.workflow_run.id }} and .name == "forwarded_instructions")')
id=$(echo $forward_artifact | jq -r '.id')
curl -sSLO -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$GH_API_ARTIFACTS/$id/zip" -D headers.txt
curl -sSLO -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$GH_API_ACTIONS/artifacts/$id/zip" -D headers.txt
- name: Print headers
run: |
cat headers.txt
- name: all_artifacts
run: |
curl -sSL "$GH_API_ARTIFACTS"
curl -sSL "$GH_API_ACTIONS/runs/${{ github.event.workflow_run.id }}/artifacts"
- name: Filtered artifacts
run: |
all_artifacts=$(curl -sSL "$GH_API_ARTIFACTS")
all_artifacts=$(curl -sSL "$GH_API_ACTIONS/runs/${{ github.event.workflow_run.id }}/artifacts")
echo $all_artifacts | jq '.artifacts[] | select(.workflow_run.id == ${{ github.event.workflow_run.id }} and .name == "forwarded_instructions")'
- name: id
run: |
all_artifacts=$(curl -sSL "$GH_API_ARTIFACTS")
all_artifacts=$(curl -sSL "$GH_API_ACTIONS/runs/${{ github.event.workflow_run.id }}/artifacts")
forward_artifact=$(echo $all_artifacts | jq '.artifacts[] | select(.workflow_run.id == ${{ github.event.workflow_run.id }} and .name == "forwarded_instructions")')
echo $forward_artifact | jq -r '.id'
- name: endpoint
run: |
all_artifacts=$(curl -sSL "$GH_API_ARTIFACTS")
all_artifacts=$(curl -sSL "$GH_API_ACTIONS/runs/${{ github.event.workflow_run.id }}/artifacts")
forward_artifact=$(echo $all_artifacts | jq '.artifacts[] | select(.workflow_run.id == ${{ github.event.workflow_run.id }} and .name == "forwarded_instructions")')
id=$(echo $forward_artifact | jq -r '.id')
echo "$GH_API_ARTIFACTS/$id/zip"
echo "$GH_API_ACTIONS/artifacts/$id/zip"
- name: Ls
run: |
ls -la
Expand Down

0 comments on commit fce07e2

Please sign in to comment.