Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Workflow not showing up in GitHub Actions

I am doing a continuous integration workflow in GitHub Actions to trigger "pytest backend/tests/" command on a push to any branch. Right now, I am testing in a feature branch. The pytest.yml file is located in /.github/workflows/. The GitHub actions is not showing my workflow, even after I push new changes.

This is my pytest.yml file

name: Run pytest on push

on:
  push:
    branches:
      - '*'

jobs:
  pytest:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.9

    - name: Install dependencies
      run: pip install -r requirements.txt

    - name: Run pytest
      run: pytest backend/tests
like image 792
chulin Avatar asked Apr 19 '26 07:04

chulin


2 Answers

Your workflow will not show up in the Actions tab until it's merged to the main branch.

The reason is because certain triggers (like push, workflow_dispatch) requires the new workflow to be merged to main branch first before showing up in Actions tab.

So to solve this, you can instead use the pull_request trigger, like:

on:
  pull_request:

Then the action should come up in the Actions tab, even before you merge your changes to the main branch.

like image 197
Robin Thomas Avatar answered Apr 23 '26 08:04

Robin Thomas


try this -

'*' - Matches all the branches except branches containg slashes ("/")

'**' - Matches all the branches

name: Run pytest on push

on:
  push:
    branches:
      - '**'
like image 22
Dayananda D R Avatar answered Apr 23 '26 08:04

Dayananda D R



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!