forked from hiero-ledger/hiero-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot-pr-missing-linked-issue.yml
More file actions
53 lines (46 loc) · 1.74 KB
/
Copy pathbot-pr-missing-linked-issue.yml
File metadata and controls
53 lines (46 loc) · 1.74 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This workflow checks PRs for missing linked issues and posts reminder comments when needed.
# Uses pull_request_target to enable write permissions for fork PRs while relying
# on the trusted base-branch checkout to avoid executing untrusted fork code.
name: PR Missing Linked Issue Reminder
on:
pull_request_target:
types: [opened, edited, reopened]
workflow_dispatch:
inputs:
pr_number:
description: "PR number to check"
required: true
type: number
dry_run:
description: "Dry run (only log, no comments)"
required: false
type: boolean
default: true
permissions:
pull-requests: write
contents: read
issues: write
jobs:
check-linked-issue:
runs-on: hl-sdk-py-lin-md
concurrency:
group: bot-pr-missing-linked-issue-${{ github.event.pull_request.number || github.event.inputs.pr_number }}
cancel-in-progress: true
steps:
- name: Harden the runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Check PR for missing linked issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
PR_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
IMMEDIATE_CHECK: "true"
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const script = require('./.github/scripts/bot-pr-missing-linked-issue.js');
await script({ github, context });