Skip to content

Commit 29c6523

Browse files
authored
ci: fix ci skip (#4154)
Signed-off-by: Carlos Amaro <carlosrscamaro@tecnico.ulisboa.pt>
1 parent ce833fd commit 29c6523

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

.github/workflows/checks-and-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- id: compute-affected-packages
9090
name: Compute Affected Packages
9191
run: |
92-
node ./tools/compute-affected-packages.cjs origin/${{ github.base_ref }} > affected-packages.json
92+
node ./tools/compute-affected-packages.cjs origin/${{ github.base_ref }} ${{ github.event_name != 'pull_request'}} > affected-packages.json
9393
AFFECTED_PACKAGES=$(jq -c '.' affected-packages.json)
9494
echo "affected_packages=$AFFECTED_PACKAGES" >> "$GITHUB_OUTPUT"
9595

.github/workflows/ci.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,12 @@ env:
1818
NODE_OPTIONS: --max-old-space-size=8192
1919

2020
jobs:
21-
check-ci-skip:
22-
if: github.event_name == 'pull_request'
23-
runs-on: ubuntu-22.04
24-
steps:
25-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
26-
- name: Check CI Skip
27-
run: node tools/ci-skip-for-maintainers.js ${{ github.event.pull_request.url }} ${{ github.event.pull_request.user.login }}
28-
2921
env-setup:
3022
outputs:
3123
node_version: ${{ steps.set-node-version.outputs.node_version }}
3224
run_code_coverage: ${{ steps.set-run-code-coverage.outputs.run_code_coverage }}
3325
run_trivy_scan: ${{ steps.set-run-trivy-scan.outputs.run_trivy_scan }}
3426
runs-on: ubuntu-22.04
35-
needs: [check-ci-skip]
3627
steps:
3728
- name: Set Node Version Output
3829
id: set-node-version

tools/compute-affected-packages.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ function findAllAffected(changed, dependents) {
180180

181181
// --- MAIN ---
182182
const packages = getAllPackages();
183+
184+
if (process.argv[2] === "true") {
185+
const affectedDirs = packages.map((pkgName) => packages[pkgName].dir);
186+
process.stdout.write(JSON.stringify(affectedDirs));
187+
process.exit(0);
188+
}
189+
183190
console.warn("Detected packages:", Object.keys(packages));
184191
const dependents = buildDependentsGraph(packages);
185192
console.warn(
@@ -200,3 +207,4 @@ const affectedDirs = affected.map((pkgName) => packages[pkgName].dir);
200207
// Output JSON for GitHub matrix
201208
console.warn("Affected package dirs:", JSON.stringify(affectedDirs));
202209
process.stdout.write(JSON.stringify(affectedDirs));
210+
process.exit(0);

0 commit comments

Comments
 (0)