-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 1.78 KB
/
test.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
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
name: CI / Test Action
on:
issues:
types: [opened, edited]
pull_request:
types: [opened, synchronize]
workflow_dispatch:
inputs:
number:
required: true
type: string
default: "10"
description: "PR/Issue Number to Run / Test Workflow on."
permissions:
pull-requests: write
issues: write
jobs:
label:
name: Label Issues and Pull Requests
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Config Files
run: |
if [[ ! -f .github/issues.yml || ! -f .github/pr.yml ]]; then
echo "Required config files not found! Please ensure .github/issues.yml and .github/pr.yml exist."
exit 1
fi
- name: Label Issues
if: github.event_name == 'issues'
uses: ./
with:
debug: true
create-labels: true
github-token: ${{ secrets.MY_PAT || github.token }}
issue-config: '.github/issues.yml'
- name: Label Pull Requests
if: github.event_name == 'pull_request'
uses: ./
with:
debug: true
create-labels: true
github-token: ${{ secrets.MY_PAT || github.token }}
pr-config: '.github/pr.yml'
- name: Manual Dispatch
if: github.event_name == 'workflow_dispatch'
uses: ./
with:
debug: true
create-labels: true
github-token: ${{ secrets.MY_PAT || github.token }}
pr-config: '.github/pr.yml'
issue-config: '.github/issues.yml'
number: ${{ github.event.inputs.number }}
- name: Debug Event Context
run: echo "${{ toJSON(github.event) }}"