docker-qemu-reactos/.github/workflows/rebuild-latest-release.yml
2022-04-26 22:11:31 +02:00

34 lines
1.3 KiB
YAML

name: 'Rebuild latest release'
on:
schedule:
- cron: '20 04 * * 1'
workflow_dispatch:
jobs:
trigger-rebuild:
name: 'Trigger rebuild'
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
steps:
- name: 'REST API call'
run: |
RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url 'https://api.github.com/repos/${{ github.repository }}/releases/latest' \
--header 'Authorization: Bearer ${{ secrets.PERSONAL_GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Content-Type: application/json' \
| jq -rc '.tag_name')"
if [ -n "${RELEASE_TAG-}" ] && [ "${RELEASE_TAG:?}" != 'null' ]; then
curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url 'https://api.github.com/repos/${{ github.repository }}/actions/workflows/main.yml/dispatches' \
--header 'Authorization: Bearer ${{ secrets.PERSONAL_GITHUB_TOKEN }}' \
--header 'Accept: application/vnd.github.v3+json' \
--header 'Content-Type: application/json' \
--data "$(jq -rn --arg tag "${RELEASE_TAG:?}" '{"ref": $tag}')"
else
exit 1
fi