-
Notifications
You must be signed in to change notification settings - Fork 34
53 lines (43 loc) · 1.52 KB
/
check-ktdoc-snippets.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
name: Check Snippet ktdoc Snippets
on:
pull_request:
types: [ opened, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-github-context:
name: Get Branches
runs-on: ubuntu-latest
# Allow the workflow to read the contents of the repository and pull request to be
# able to retrieve list of changed files when PR is opened from forked repository.
permissions:
contents: read
pull-requests: read
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v8
- name: List Branches
run: |
echo current branch: ${{ steps.branch-name.outputs.current_branch }}
echo base ref branch branch: ${{ steps.branch-name.outputs.base_ref_branch }}
echo default branch: ${{ steps.branch-name.outputs.default_branch }}
outputs:
current_branch: ${{ steps.branch-name.outputs.current_branch }}
base_ref_branch: ${{ steps.branch-name.outputs.base_ref_branch }}
all_changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
check-ktdoc-snippets:
name: Check ktdoc Snippets
needs: get-github-context
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: Run Python Script for All Files
run: python3 scripts/check_ktdoc_snippets.py -all