Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
tiawl committed Apr 29, 2024
1 parent 5e2aeaa commit 6ecd8d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/dump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ jobs:

- name: Check client payload hash field
env:
ZIG: "${{ env.zig }}"
PAYLOAD_HASH: "${{ github.event.client_payload.hash }}"
URL: "${{ github.server_url }}/${{ github.repository_owner }}/${{ github.event.client_payload.dependency }}/archive/refs/tags/${{ github.event.client_payload.tag }}.tar.gz"
ZIG: "${{ env.zig }}"
shell: bash
run: |
if [[ "${ZIG}" == 'true' ]]
then
[[ "${PAYLOAD_HASH}" == "$(zig fetch "${GITHUB_WORKFLOW}")" ]]
[[ "${PAYLOAD_HASH}" == "$(zig fetch "${URL}")" ]]
else
[[ -z "${PAYLOAD_HASH}" ]]
fi
8 changes: 2 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ runs:
with:
version: ${{ env.zig_version }}

- uses: actions/checkout@v4
with:
repository: "${{ github.repository_owner }}/${{ inputs.repository_name }}"
ref: "${{ inputs.tag }}"

- name: Notify ${{ inputs.user }}
env:
ENDPOINT: "/repos/${{ github.repository_owner }}/${{ inputs.user }}/dispatches"
Expand All @@ -41,9 +36,10 @@ runs:
IS_COMPOSITE: "${{ inputs.is_composite }}"
PAYLOAD_DEPENDENCY: "client_payload[dependency]=${{ inputs.repository_name }}"
PAYLOAD_TAG: "client_payload[tag]=${{ inputs.tag }}"
URL: "${{ github.server_url }}/${{ github.repository_owner }}/${{ inputs.repository }}/archive/refs/tags/${{ inputs.tag }}.tar.gz"
shell: ${{ env.shell }}
run: |
payload_hash="client_payload[hash]=$(if [[ "${IS_COMPOSITE}" != 'true' ]]; then zig fetch "${GITHUB_WORKSPACE}"; fi)"
payload_hash="client_payload[hash]=$(if [[ "${IS_COMPOSITE}" != 'true' ]]; then zig fetch "${URL}"; fi)"
gh api --method POST \
-H 'Accept: application/vnd.github+json' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
Expand Down

0 comments on commit 6ecd8d4

Please sign in to comment.