Skip to content
Discussion options

You must be logged in to vote

You can reuse workflows by creating a reusable workflow in one repository and then calling it from others.

  1. Define the reusable workflow in the source repo, e.g.:
# .github/workflows/ci.yml
on:
  workflow_call:   # 👈 makes it reusable
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Running shared build..."
  1. Call it from another repo:
  on:
    push:
      branches: [ main ]
  
  jobs:
    call-ci:
      uses: org-name/repo-name/.github/workflows/ci.yml@main
  1. Notes / Best Practices
  • The reusable workflow must have workflow_call in its trigger.
  • Reference it with org/repo/path@ref (branch, tag, or commit SHA).
  • Keep shared workflow…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Alen-Kendrik
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raja-anbazhagan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other General topics and discussions that don't fit into other categories, but are related to GitHub Question Ask and answer questions about GitHub features and usage
4 participants