Dusyanth Maniks
Dusyanth Maniks

Reputation: 103

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?

Upvotes: 10

Views: 8459

Answers (1)

riQQ
riQQ

Reputation: 12693

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.

Upvotes: 14

Related Questions