Skip to content

GitHub Actions Investigation Notes

Context

Testing GitHub workflows using a Test Repository sf-trial-devops

Running self-hosted organisation action runners for GitHub as configured in repository sf-workflows.

Problem 1 - Runner did not pick up jobs

Symptoms:

Requested labels: self-hosted, sf-build
Waiting for a runner to pick up this job...

Facts verified:

  • Reusable workflow was accessible.
  • Runner was online and Idle.
  • Labels matched.
  • Runner group was Default.
  • Repository access was configured.

Root cause:

The repository sf-trial-devops is public, while the organization runner group had:

Allow public repositories = disabled

As a result GitHub would not assign jobs to the runner.

Resolution:

Enable:

Organization Settings
  -> Actions
  -> Runner Groups
  -> Allow public repositories

After enabling this setting, manually triggered workflows executed successfully.


Problem 2 - Push workflow was skipped

Workflow triggers:

on:
    push:
        branches: [ '**' ]

    pull_request:

    workflow_dispatch:

Reusable workflow condition:

check-env:
    if: github.event_name != 'push' || github.ref_protected

For a push to branch dev-hotfix:

github.event_name = push
github.ref_protected = false

Evaluation:

false || false
=> false

Result:

Job skipped

This behavior is intentional.


Why two workflow runs appeared

The branch dev-hotfix had an open pull request.

A single:

git push origin dev-hotfix

creates two GitHub events:

1. push
2. pull_request (synchronize)

Therefore two workflow runs are created nearly simultaneously.

Run A:

Trigger : push
Result  : skipped

Run B:

Trigger : pull_request synchronize
Result  : executed

The matching timestamps observed in GitHub Actions are expected.


Simplified Flow

uml diagram


Final Conclusions

Runner issue:

Cause: Allow public repositories disabled
Fix:   Enable public repositories

Skipped workflow:

Cause: Workflow condition intentionally skips
       pushes to unprotected branches.

Observed behaviour:

Feature branch push      -> skipped
Pull request update     -> executed
Workflow dispatch       -> executed
Protected branch push   -> executed