Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Coditory Skip GitHub Action

GitHub action that skips run if:

  • Previous commit passed workflow
  • and there are important files in the push/pull_request

Why should you use this action?

Sample usage

name: Build

on:
  workflow_dispatch:
  pull_request:
  push:
    branches-ignore:
      - 'dependabot/**'
      - 'gh-pages'

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    # Skip duplicate build on pull_request if pull request uses branch from the same repository
    if: github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Skip build if not needed
        id: skipper
        uses: coditory/action-skipper@v1
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          skip-files: |-
            ^.gitignore
            ^[^/]*\.md
            ^.github/.*\.md
            ^docs/.*
            ^gradle.properties

      - name: Setup JDK
        uses: actions/setup-java@v4
        if: steps.skipper.outputs.skip != 'true'
        with:
          java-version: 21
          distribution: temurin

References

See:

About

GitHub action for skipping unnecessary builds

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Used by

Contributors

Languages