forked from coreos/fedora-coreos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 1.13 KB
/
next-devel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
name: next-devel
on:
# This is a privileged event! It runs with a r/w token, even in PRs from
# forks.
pull_request_target:
branches: [next-devel]
types: [opened, edited, reopened, ready_for_review]
permissions:
pull-requests: write
# Privileged job to comment on next-devel PRs indicating whether next-devel
# is currently open. This job must not trust the contents of the PR.
jobs:
branch-status:
name: "Check branch status"
runs-on: ubuntu-latest
steps:
- name: Post PR comment
uses: actions/github-script@v6
with:
script: |
const url = 'https://raw.githubusercontent.com/coreos/fedora-coreos-pipeline/main/next-devel/status.json'
const resp = await github.request(url)
if (!JSON.parse(resp.data).enabled) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: ':no_entry: The `next-devel` branch is currently closed. PRs should target only `testing-devel`.',
})
}