Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Actions Multiple action in a single repo

I have a Application Code in a Github Repo and I would like to customise certain stages of my Pipeline and would like to write my own custom action (in a private repo) since these custom action has to be placed in the repo where the actions is to be run can I save multiple actions in a single repo?

also is there any way where these repos can be used within a Organization in a private repo?

like image 455
Dusyanth Maniks Avatar asked Apr 23 '26 06:04

Dusyanth Maniks


1 Answers

If you're building an action that you don't plan to make available to the public, you can store the action's files in any location in your repository. If you plan to combine action, workflow, and application code in a single repository, we recommend storing actions in the .github directory. For example, .github/actions/action-a and .github/actions/action-b.

source: https://docs.github.com/en/actions/creating-actions/about-custom-actions#choosing-a-location-for-your-action

name: Workflow using an action
on:
  [your trigger here ...]

jobs:
  job:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: ./.github/actions/action-a

This works with private repositories in an organization, if you checkout the private repository containing the action and reference it relatively like in the example above.

like image 110
riQQ Avatar answered Apr 26 '26 08:04

riQQ



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!