[ci:force][MIGRATION] - print-affected has been changed

This commit is contained in:
VitoAlbano 2024-08-16 00:11:24 +01:00
parent d1c410563e
commit a046562b28
4 changed files with 9 additions and 9 deletions

View File

@ -55,7 +55,7 @@ runs:
id: determine-affected id: determine-affected
run: | run: |
isAffected=false isAffected=false
affectedLibs=$(npx nx print-affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain) affectedLibs=$(npx nx show projects --affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain)
if [[ $affectedLibs =~ "${{ inputs.e2e-test-id }}" ]]; then if [[ $affectedLibs =~ "${{ inputs.e2e-test-id }}" ]]; then
isAffected=true isAffected=true
fi; fi;

View File

@ -2,7 +2,7 @@ const core = require('@actions/core');
const exec = require('@actions/exec'); const exec = require('@actions/exec');
async function run() { async function run() {
const base = core.getInput('base', {required: false }) || '5288597580'; const base = core.getInput('base', { required: false }) || '5288597580';
core.setOutput('affected_is_empty', 'true'); core.setOutput('affected_is_empty', 'true');
let affected = ''; let affected = '';
@ -11,15 +11,15 @@ async function run() {
const options = {}; const options = {};
options.listeners = { options.listeners = {
stdout: (data) => { stdout: (data) => {
affected += data.toString() affected += data.toString();
}, },
stderr: (data) => { stderr: (data) => {
myError += data.toString(); myError += data.toString();
} }
}; };
await exec.exec(`npx nx print-affected --target=build --select=tasks.target.project --base=${base} --head=${head}`, [], options) await exec.exec(`npx nx show projects --affected --target=build --select=tasks.target.project --base=${base} --head=${head}`, [], options);
const affectedTrimmed = affected.trim(); const affectedTrimmed = affected.trim();
if (affectedTrimmed !== '') { if (affectedTrimmed !== '') {
core.setOutput('affected_is_empty', 'false'); core.setOutput('affected_is_empty', 'false');
@ -29,4 +29,4 @@ async function run() {
core.setOutput('affected', affectedTrimmed); core.setOutput('affected', affectedTrimmed);
} }
run(); run();

View File

@ -208,7 +208,7 @@ jobs:
npx nx run js-api:bundle npx nx run js-api:bundle
npx nx run cli:bundle npx nx run cli:bundle
npx nx run testing:bundle npx nx run testing:bundle
- run: npx nx print-affected $NX_CALCULATION_FLAGS - run: npx nx show projects --affected $NX_CALCULATION_FLAGS
- uses: ./.github/actions/upload-node-modules-and-artifacts - uses: ./.github/actions/upload-node-modules-and-artifacts
unit-tests: unit-tests:

View File

@ -11,7 +11,7 @@ if [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
exit 0 exit 0
fi fi
isAffected=false isAffected=false
AFFECTED_LIBS=$(npx nx print-affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain) AFFECTED_LIBS=$(npx nx show projects --affected --type=lib --select=projects ${NX_CALCULATION_FLAGS} --plain)
#echo "Verify if affected build contains $1" #echo "Verify if affected build contains $1"
#echo "Affected libs:$AFFECTED_LIBS" #echo "Affected libs:$AFFECTED_LIBS"
if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then