Closed ctmbl closed 2 months ago
with workflow code:
echo ${{ github.event.repository.fork }}
echo ${{ github.event_name }}
echo ''
echo ${{ '1' == '1' }}
echo ${{ ('1' == '1') }}
echo ${{ ('1' == '1') || 'a' == 'b' }}
echo ${{ ('1' == '1' && '2' == '2') }}
echo ${{ ('1' == '1' && '2' == '2') || 'a' == 'b' }}
echo ''
echo ${{ github.event_name == 'pull_request' }}
echo ${{ github.event.repository.fork == 'false' }}
echo ${{ ! github.event.repository.fork }}
echo ${{ (github.event_name == 'pull_request') }}
echo ${{ (github.event_name == 'pull_request' && github.event.repository.fork == 'false') }}
echo ${{ (github.event_name == 'pull_request') || github.event_name == 'workflow_dispatch' }}
echo ${{ (github.event_name == 'pull_request' && github.event.repository.fork == 'false') || github.event_name == 'workflow_dispatch' }}
I got the output:
false
pull_request
true
true
true
true
true
true
false
true
true
false
true
false
here: https://github.com/iScsc/blog.iscsc.fr/actions/runs/8954207026/job/24593567567
The important part is that:
${{ github.event.repository.fork }}
evaluates to false
${{ github.event.repository.fork == 'false' }}
evaluates to false
despite the previous line!!!
${{ ! github.event.repository.fork }}
evaluates to true
which is expected!!
https://github.com/iScsc/blog.iscsc.fr/actions/runs/8949748241 has been skipped while it should not have been because https://github.com/iScsc/blog.iscsc.fr/pull/56/files contained a change in
./src
and was a merge == a push to main