appveyor-status.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (C) 2000 - 2022 Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: AppVeyor Status Report
  5. on:
  6. status
  7. concurrency:
  8. group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}
  9. cancel-in-progress: true
  10. permissions:
  11. statuses: write
  12. jobs:
  13. split:
  14. runs-on: ubuntu-latest
  15. if: ${{ github.event.sender.login == 'appveyor[bot]' }}
  16. steps:
  17. - name: Create individual AppVeyor build statuses
  18. if: ${{ github.event.sha && github.event.target_url }}
  19. env:
  20. APPVEYOR_COMMIT_SHA: ${{ github.event.sha }}
  21. APPVEYOR_TARGET_URL: ${{ github.event.target_url }}
  22. APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
  23. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  24. run: |
  25. echo ${APPVEYOR_TARGET_URL} | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s | \
  26. jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
  27. context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
  28. state: (.status | sub("queued"; "pending")
  29. | sub("starting"; "pending")
  30. | sub("running"; "pending")
  31. | sub("failed"; "failure")
  32. | sub("cancelled"; "error")),
  33. description: .status}' \
  34. --arg target_url ${APPVEYOR_TARGET_URL} | tee /dev/stderr | parallel --pipe -j 1 -N 1 \
  35. gh api --silent --input - repos/${APPVEYOR_REPOSITORY}/statuses/${APPVEYOR_COMMIT_SHA}