yakshaveinc / linux

software engineering for Linux projects
The Unlicense
1 stars 3 forks source link

Test Actions context on PRs from forks #50

Closed abitrolly closed 2 years ago

abitrolly commented 2 years ago

Continuation of #44. To detect if github.ref == 'refs/heads/master' will be different when PR is made from master in forked repo.

abitrolly commented 2 years ago

Here is the result.

github.ref: refs/pull/50/merge
github.base_ref: master
github.head_ref: master
github.event: Object
github.event_name: pull_request
github.event.base_ref: 
--- refs/pull/50/merge + 
--- false
--- false
--- false

Report for the same commit in forked repo.

github.ref: refs/heads/master
github.base_ref: 
github.head_ref: 
github.event: Object
github.event_name: push
github.event.base_ref: 
--- refs/heads/master + 
--- false
--- false
--- false

So checking for ref/heads/master is a reliable filter to skip steps.