Skip to content

jaymzh/main-branch-check-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

main-branch-check action

Build

This check will determine the workflow it was called from, then see if the workflow has run on master, and if it has, ensure it is passing.

To bypass this (e.g. if your PR is the fix), you can add:

[ci override_main_branch_checks $WORKFLOW]'

Or you to set all checks to non-fatal, you can do:

[ci override_main_branch_checks]

to your PR description.

Using

To use this, add a step into your workflow (or a separate job with this step) like:

- name: Main Branch Check
  # Do the check even if the PR failed elsewhere,
  # but don't do it if we're on main
  if: always() && github.ref != 'refs/heads/main'
  uses: jaymzh/main-branch-check-action@main
  with:
    gh_token: ${{ secrets.GITHUB_TOKEN }}
    workflow_ref: ${{ github.workflow_ref }}

If your branch name is different than "main" you will need to update the ref in the if as well as pass it in using with:

...
  with:
    ...
    main_branch: "some_branch_name"

In most cases the standard dyanmic per-PR token that GitHub generates will work just fine.

Updating

If you update the code, run:

make

to build the self-contained bundle.

If you update dependencies you'll need to run npm install first

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors