-
Notifications
You must be signed in to change notification settings - Fork 5
40 lines (35 loc) · 1.3 KB
/
pack-validation.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
name: Packs Validation
# # Controls when the action will run. Workflow runs when manually triggered using the UI
# # or API.
on:
pull_request:
branches: [ main ]
# # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# # This workflow contains a single job called "validator"
validator:
# # The type of runner that the job will run on
runs-on: ubuntu-latest
# # Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y nodejs npm
sudo npm install -g validate-json
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
# # Checkout code
- name: Checkout branch
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
# # Run Validations
- name: Check Packs
shell: bash
run: |
echo "${{ steps.changed-files.outputs.all_changed_files }}" >> /tmp/modified_files
chmod +x ${GITHUB_WORKSPACE}/validator/validate-packs.sh
cd ${GITHUB_WORKSPACE}/validator
./validate-packs.sh