firmware/.github/workflows/hook_copr.yml
Austin dd9ab7f0e1
Some checks failed
Daily Packaging / package-ppa (jammy) (push) Has been cancelled
Daily Packaging / package-ppa (noble) (push) Has been cancelled
Daily Packaging / package-ppa (oracular) (push) Has been cancelled
Daily Packaging / package-ppa (plucky) (push) Has been cancelled
Daily Packaging / package-obs (push) Has been cancelled
Daily Packaging / hook-copr (push) Has been cancelled
CI / setup (check) (push) Has been cancelled
CI / setup (esp32) (push) Has been cancelled
CI / setup (esp32c3) (push) Has been cancelled
CI / setup (esp32c6) (push) Has been cancelled
CI / setup (esp32s3) (push) Has been cancelled
CI / setup (nrf52840) (push) Has been cancelled
CI / setup (rp2040) (push) Has been cancelled
CI / setup (stm32) (push) Has been cancelled
CI / package-raspbian (push) Has been cancelled
CI / package-raspbian-armv7l (push) Has been cancelled
CI / package-native (push) Has been cancelled
CI / build-debian-src (push) Has been cancelled
CI / test-native (push) Has been cancelled
CI / build-docker (push) Has been cancelled
Flawfinder Scan / Flawfinder (push) Has been cancelled
CI / check (push) Has been cancelled
CI / build-esp32 (push) Has been cancelled
CI / build-esp32-s3 (push) Has been cancelled
CI / build-esp32-c3 (push) Has been cancelled
CI / build-esp32-c6 (push) Has been cancelled
CI / build-nrf52 (push) Has been cancelled
CI / build-rpi2040 (push) Has been cancelled
CI / build-stm32 (push) Has been cancelled
CI / after-checks (push) Has been cancelled
CI / gather-artifacts (esp32) (push) Has been cancelled
CI / gather-artifacts (esp32c3) (push) Has been cancelled
CI / gather-artifacts (esp32c6) (push) Has been cancelled
CI / gather-artifacts (esp32s3) (push) Has been cancelled
CI / gather-artifacts (nrf52840) (push) Has been cancelled
CI / gather-artifacts (rp2040) (push) Has been cancelled
CI / gather-artifacts (stm32) (push) Has been cancelled
CI / release-artifacts (push) Has been cancelled
CI / release-firmware (esp32) (push) Has been cancelled
CI / release-firmware (esp32c3) (push) Has been cancelled
CI / release-firmware (esp32c6) (push) Has been cancelled
CI / release-firmware (esp32s3) (push) Has been cancelled
CI / release-firmware (nrf52840) (push) Has been cancelled
CI / release-firmware (rp2040) (push) Has been cancelled
CI / release-firmware (stm32) (push) Has been cancelled
Small Fix: Release_Channels permissions (#5852)
2025-01-14 15:17:54 +08:00

62 lines
1.7 KiB
YAML

name: Trigger COPR build
on:
workflow_call:
secrets:
COPR_HOOK_DAILY:
COPR_HOOK_ALPHA:
COPR_HOOK_BETA:
inputs:
copr_project:
description: COPR project to target
required: true
type: string
permissions:
contents: write
packages: write
jobs:
build-copr-hook:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: Install Python dependencies
run: |
pip install requests
- name: Trigger COPR build
shell: python
run: |
import requests
project_name = "${{ inputs.copr_project }}"
if project_name == "daily":
hook_secret = "${{ secrets.COPR_HOOK_DAILY }}"
project_id = 160277
elif project_name == "alpha":
hook_secret = "${{ secrets.COPR_HOOK_ALPHA }}"
project_id = 160278
elif project_name == "beta":
hook_secret = "${{ secrets.COPR_HOOK_BETA }}"
project_id = 160279
else:
raise ValueError(f"Unknown COPR project: {project_name}")
webhook_url = f"https://copr.fedorainfracloud.org/webhooks/github/{project_id}/{hook_secret}/meshtasticd/"
copr_payload = {
"ref": "${{ github.ref }}",
"after": "${{ github.sha }}",
"repository": {
"clone_url": "${{ github.server_url }}/${{ github.repository }}.git",
}
}
r = requests.post(webhook_url, json=copr_payload, headers={"X-GitHub-Event": "push"})
r.raise_for_status()