appveyor-status.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright (C) 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. jobs:
  12. split:
  13. runs-on: ubuntu-latest
  14. if: ${{ github.event.sender.login == 'appveyor[bot]' }}
  15. permissions:
  16. statuses: write
  17. steps:
  18. - name: Create individual AppVeyor build statuses
  19. if: ${{ github.event.sha && github.event.target_url }}
  20. env:
  21. APPVEYOR_COMMIT_SHA: ${{ github.event.sha }}
  22. APPVEYOR_TARGET_URL: ${{ github.event.target_url }}
  23. APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
  24. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  25. run: |
  26. echo ${APPVEYOR_TARGET_URL} | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s | \
  27. jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
  28. context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
  29. state: (.status | sub("queued"; "pending")
  30. | sub("starting"; "pending")
  31. | sub("running"; "pending")
  32. | sub("failed"; "failure")
  33. | sub("cancelled"; "error")),
  34. description: .status}' \
  35. --arg target_url ${APPVEYOR_TARGET_URL} | tee /dev/stderr | parallel --pipe -j 1 -N 1 \
  36. gh api --silent --input - repos/${APPVEYOR_REPOSITORY}/statuses/${APPVEYOR_COMMIT_SHA}