-
Notifications
You must be signed in to change notification settings - Fork 1.1k
75 lines (64 loc) · 2.08 KB
/
close-xls-discussions.yml
File metadata and controls
75 lines (64 loc) · 2.08 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Close XLS Discussions
on:
push:
branches:
- master
paths:
- "XLS-*/README.md"
workflow_dispatch:
inputs:
scan_all:
description: "Scan all XLS folders (not just changed files)"
required: false
default: true
type: boolean
dry_run:
description: "Dry run mode (no actual changes)"
required: false
default: false
type: boolean
permissions:
discussions: write
contents: read
env:
CLOSE_MESSAGE: |
This discussion has been merged into an XLS and is now being closed.
Thank you for your contribution to the XRP Ledger Standards process!
jobs:
close-discussions:
runs-on: ubuntu-latest
if: github.repository == 'XRPLF/XRPL-Standards'
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Get changed XLS files
id: changed-files
if: github.event_name == 'push'
uses: tj-actions/changed-files@v47
with:
files: |
XLS-*/README.md
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install beautifulsoup4
- name: Generate token from GitHub App
id: generate_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Close merged XLS discussions
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }}
CLOSE_MESSAGE: ${{ env.CLOSE_MESSAGE }}
SCAN_ALL: ${{ github.event_name == 'workflow_dispatch' && inputs.scan_all || 'false' }}
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'false' }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
python .github/scripts/close-xls-discussions.py