Skip to content

Commit 72db0e1

Browse files
committed
wip
1 parent b85df78 commit 72db0e1

2 files changed

Lines changed: 55 additions & 56 deletions

File tree

.github/workflows/validate-main.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,58 @@ jobs:
2323
with:
2424
runner-type: 'github-hosted'
2525
timeout: 480
26+
27+
static-check:
28+
name: 'See if Static Analysis should run'
29+
runs-on: ubuntu-latest
30+
31+
outputs:
32+
all-changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Get all changed files for this PR
40+
id: changed-files
41+
uses: tj-actions/changed-files@v42
42+
with:
43+
files_ignore_from_source_file: changed-files-ignore-list.txt
44+
separator: ","
45+
46+
- name: List changed files, skipping this job if there are no files to analyze
47+
run: |
48+
if [ "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" == "" ]; then
49+
echo 'No files eligible for scanning were changed. Skipping Static Analysis.'
50+
exit 0
51+
else
52+
echo ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
53+
fi
54+
55+
static:
56+
name: 'Run Static Analysis'
57+
runs-on: ubuntu-latest
58+
needs: static-check
59+
if: needs.static-check.outputs.all-changed-files != ''
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
66+
- name: Install Salesforce CLI & Salesforce Code Analyzer
67+
run: |
68+
echo "Installing Salesforce CLI & Salesforce Code Analyzer"
69+
70+
- name: Run Salesforce Code Analyzer
71+
id: run-code-analyzer
72+
# uses: forcedotcom/run-code-analyzer@v1
73+
run: |
74+
echo "Running Salesforce Code Analyzer"
75+
76+
- name: Check the outputs to determine whether to fail
77+
if: |
78+
steps.run-code-analyzer.outputs.exit-code > 0 ||
79+
steps.run-code-analyzer.outputs.num-sev1-violations > 0
80+
run: exit 1

.github/workflows/validate.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -89,62 +89,6 @@ jobs:
8989
echo "Deleting stale CI org"
9090
9191

92-
93-
static-check:
94-
name: 'See if Static Analysis should run'
95-
runs-on: ubuntu-latest
96-
97-
outputs:
98-
all-changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
99-
100-
steps:
101-
- uses: actions/checkout@v4
102-
with:
103-
fetch-depth: 0
104-
105-
- name: Get all changed files for this PR
106-
id: changed-files
107-
uses: tj-actions/changed-files@v42
108-
with:
109-
files_ignore_from_source_file: changed-files-ignore-list.txt
110-
separator: ","
111-
112-
- name: List changed files, skipping this job if there are no files to analyze
113-
run: |
114-
if [ "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" == "" ]; then
115-
echo 'No files eligible for scanning were changed. Skipping Static Analysis.'
116-
exit 0
117-
else
118-
echo ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
119-
fi
120-
121-
static:
122-
name: 'Run Static Analysis'
123-
runs-on: ubuntu-latest
124-
needs: static-check
125-
if: needs.static-check.outputs.all-changed-files != ''
126-
127-
steps:
128-
- uses: actions/checkout@v4
129-
with:
130-
fetch-depth: 0
131-
132-
- name: Install Salesforce CLI & Salesforce Code Analyzer
133-
run: |
134-
echo "Installing Salesforce CLI & Salesforce Code Analyzer"
135-
136-
- name: Run Salesforce Code Analyzer
137-
id: run-code-analyzer
138-
# uses: forcedotcom/run-code-analyzer@v1
139-
run: |
140-
echo "Running Salesforce Code Analyzer"
141-
142-
- name: Check the outputs to determine whether to fail
143-
if: |
144-
steps.run-code-analyzer.outputs.exit-code > 0 ||
145-
steps.run-code-analyzer.outputs.num-sev1-violations > 0
146-
run: exit 1
147-
14892
# validate-package-coverage:
14993
# name: 'Validate Package Metadata Coverage'
15094
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)