Skip to content

[CI] 2nd attempt to skip filtering large PR #17761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/sycl-detect-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
uses: actions/github-script@v7
with:
script: |
console.log("Number of files changed:");
console.log(context.payload.pull_request.changed_files);
return context.payload.pull_request.changed_files ;
const changedFiles = context.payload.pull_request.changed_files;
Copy link
Contributor

@sarnex sarnex Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For numerical comparison, the fromJSON() function can be used to convert a string to a number. For more information on the fromJSON() function, see fromJSON."

https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions

Can we just use this in the if?

Copy link
Contributor Author

@jsji jsji Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can. My understanding is that if in steps is not Javascript. We can only access context only in JavaScript ( script in steps).

"The script directly accesses
context.payload.pull_request.changed_files and performs the comparison
within the JavaScript environment, which is more flexible and allows for
direct manipulation of data."

"The if condition in GitHub Actions is evaluated using the expression
syntax, which requires correct access to step outputs and proper
handling of data types. "

Copy link
Contributor

@sarnex sarnex Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is that explanation from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, you meant we call fromJSON to convert the value to number in if.
Certainly we can try.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is that explanation from?

GPT. :P

console.log("Number of files changed:", changedFiles);
return { changed_file_cnt: changedFiles } ;

- name: Check file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
if: ${{ steps.changed_files.outputs.changed_files }} < 500
if: ${{ steps.changed_files.outputs.changed_file_cnt }} < 500
id: changes
with:
filters: |
Expand Down
Loading