docker-qemu-reactos/.github/workflows/rebuild-latest-release.yml
Héctor Molinero Fernández ae82178446 Reformat GitHub YAML files
2024-07-20 11:58:32 +02:00

38 lines
1.4 KiB
YAML

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Rebuild latest release"
on:
schedule:
- cron: "20 04 * * 1"
workflow_dispatch:
permissions: {}
jobs:
trigger-rebuild:
name: "Trigger rebuild"
runs-on: "ubuntu-latest"
permissions:
contents: "read"
steps:
- name: "REST API call"
env:
GITHUB_PAT: "${{ secrets.PERSONAL_GITHUB_TOKEN }}"
run: |
RELEASE_TAG="$(curl -fsS --proto '=https' --tlsv1.3 --globoff \
--url "https://api.github.com/repos/${GITHUB_REPOSITORY:?}/releases/latest" \
--header "Authorization: Bearer ${GITHUB_PAT:?}" \
--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 ${GITHUB_PAT:?}" \
--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