Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report redundant branch checks in GitHub Workflow jobs #434

Open
ilya-hontarau opened this issue Jun 18, 2024 · 0 comments
Open

Report redundant branch checks in GitHub Workflow jobs #434

ilya-hontarau opened this issue Jun 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ilya-hontarau
Copy link

If a workflow is triggered only by pushes to a specific branch, any checks for this branch within the jobs are redundant and should be removed. For example:

on:
  push:
    branches:
      - main

jobs:
  deploy:
    steps:
      - name: Deploy
        if: github.ref == 'refs/heads/main' # Unnecessary, this condition will always be true

Use Case:
During refactoring, it is easy to leave such unnecessary checks in the workflow.

@rhysd rhysd added the enhancement New feature or request label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants