Skip to content

[CI] Combine push and root#21251

Closed
iluuu1994 wants to merge 6 commits intophp:masterfrom
iluuu1994:ci-combine-push-and-root
Closed

[CI] Combine push and root#21251
iluuu1994 wants to merge 6 commits intophp:masterfrom
iluuu1994:ci-combine-push-and-root

Conversation

@iluuu1994
Copy link
Member

No description provided.

@iluuu1994 iluuu1994 force-pushed the ci-combine-push-and-root branch from 826d2cd to 5adef7f Compare February 18, 2026 16:51
@iluuu1994 iluuu1994 force-pushed the ci-combine-push-and-root branch from 5adef7f to 4f9ed98 Compare February 18, 2026 16:51
@iluuu1994 iluuu1994 changed the title Ci combine push and root [CI] Combine push and root Feb 18, 2026
@iluuu1994 iluuu1994 force-pushed the ci-combine-push-and-root branch from 4fa5d39 to 1cd6d8c Compare February 18, 2026 17:14
The ref is very long and makes things unreadable.
@iluuu1994 iluuu1994 force-pushed the ci-combine-push-and-root branch from 1cd6d8c to 33a1b50 Compare February 18, 2026 17:14
@iluuu1994 iluuu1994 force-pushed the ci-combine-push-and-root branch from 0ffcff5 to 3ed52b0 Compare February 18, 2026 18:29
@iluuu1994 iluuu1994 force-pushed the ci-combine-push-and-root branch from 3ed52b0 to 33a5586 Compare February 18, 2026 18:42
@iluuu1994
Copy link
Member Author

Merged as bcbc9c2..be96ae6.

@iluuu1994 iluuu1994 closed this Feb 18, 2026
# When running nightly, set fetch-depth to 0 to clone the full
# repository including all branches. This is required to find the
# correct commit hashes.
fetch-depth: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 0 || 1 }}
Copy link
Member

Choose a reason for hiding this comment

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

I think this might not work correctly, because 0 is falsy in JavaScript, which I believe backs the expression syntax.

&& "0" || "1" should do the trick.

Possibly it also makes sense to add an extra step setting a “helper” variable, for readability:

    - name: Check nightly
      id: is-nightly
      run: |
        if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
            echo "nightly=1" >> $GITHUB_OUTPUT
        else
            echo "nightly=0" >> $GITHUB_OUTPUT
        fi

And then use ${{ steps.is-nightly.outputs.nightly }} in conditions instead of repeating them.

Copy link
Member Author

@iluuu1994 iluuu1994 Feb 18, 2026

Choose a reason for hiding this comment

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

Very good catch. I fixed this in the first way you suggested for now. And I also remembered that "" needs to be '' after I already pushed the fix. ^^

id: set-matrix
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}"
run: php .github/matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}"
PUSH:
Copy link
Member

Choose a reason for hiding this comment

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

Should be renamed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments