Skip to content

ci: deploy jobs in push.yml are skipped because they only run on refs/heads/main #4766

@fallintoplace

Description

@fallintoplace

Description

The deploy jobs in .github/workflows/push.yml currently only run when:

if: github.ref == 'refs/heads/main'

However, the repository's current default branch is 16.x.x, and there is no main branch in the repository.

That means the deploy jobs appear to be unreachable on the active branches that currently carry this workflow.

Current workflow

on: push

jobs:
  deploy-to-npm-branch:
    needs: ci
    if: github.ref == 'refs/heads/main'
    ...

  deploy-to-deno-branch:
    needs: ci
    if: github.ref == 'refs/heads/main'
    ...

Evidence

  • gh repo view graphql/graphql-js --json defaultBranchRef reports the default branch as 16.x.x.
  • git branch -r in a fresh clone does not show origin/main.
  • A recent push.yml run on the default branch (16.x.x) completed CI and artifact build jobs, but both deploy jobs were skipped:
    • workflow run: Push run 26132380585
    • head branch: 16.x.x
    • skipped jobs: Deploy to 'npm' branch and Deploy to 'deno' branch

Possible fix

Update the branch condition to match the branch that should actually trigger these deployments, or otherwise derive it from the current release workflow.

Follow-up

If the branch gate is updated, the commit_message values in the same workflow may also need attention because they currently reference github.event.workflow_run.head_sha, even though this workflow runs on push events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions