Skip to content

Commit

Permalink
Small Fix: Release_Channels permissions (#5852)
Browse files Browse the repository at this point in the history
  • Loading branch information
vidplace7 authored Jan 14, 2025
1 parent 729c39f commit dd9ab7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 27 deletions.
38 changes: 12 additions & 26 deletions .github/workflows/hook_copr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,24 @@ jobs:
project_name = "${{ inputs.copr_project }}"
if project_name == "daily":
hook_secret = "${{ secrets.COPR_HOOK_DAILY }}"
project_id = 160277
hook_secret = "${{ secrets.COPR_HOOK_DAILY }}"
project_id = 160277
elif project_name == "alpha":
hook_secret = "${{ secrets.COPR_HOOK_ALPHA }}"
project_id = 160278
hook_secret = "${{ secrets.COPR_HOOK_ALPHA }}"
project_id = 160278
elif project_name == "beta":
hook_secret = "${{ secrets.COPR_HOOK_BETA }}"
project_id = 160279
hook_secret = "${{ secrets.COPR_HOOK_BETA }}"
project_id = 160279
else:
raise ValueError(f"Unknown COPR project: {project_name}")
raise ValueError(f"Unknown COPR project: {project_name}")
webhook_url = f"https://copr.fedorainfracloud.org/webhooks/github/{project_id}/{hook_secret}/meshtasticd/"
copr_payload = {
"event": "push",
"payload": {
"ref": "${{ github.ref }}",
"after": "${{ github.sha }}",
"repository": {
"id": "${{ github.repository_id }}",
"full_name": "${{ github.repository }}",
"git_url": "${{ github.repositoryUrl }}",
"owner": {
"name": "${{ github.repository_owner }}"
}
},
"pusher": {
"name": "${{ github.actor }}"
},
"sender": {
"login": "github-actions[bot]"
}
"ref": "${{ github.ref }}",
"after": "${{ github.sha }}",
"repository": {
"clone_url": "${{ github.server_url }}/${{ github.repository }}.git",
}
}
r = requests.post(webhook_url, json=copr_payload)
r = requests.post(webhook_url, json=copr_payload, headers={"X-GitHub-Event": "push"})
r.raise_for_status()
4 changes: 3 additions & 1 deletion .github/workflows/release_channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
release:
types: [published, released]

permissions: read-all
permissions:
contents: write
packages: write

jobs:
package-ppa:
Expand Down

0 comments on commit dd9ab7f

Please sign in to comment.