I would like my repo to have 2 functions:
Both require an action.
@chenghopan! If you want to have two actions inside the same repository, they should be located in separate directories.
However, the action.yml
file is not required.
This file is only required for an action if you plan to list it in the GitHub Marketplace.
If you have the actions in the same repo, they can have their own action.yml
file located along with their Dockerfile or node script. Here's an example with two dockerfiles:
.
├── README.md
├── .github
│ └── workflows
│ └── main.yml
├── action1
│ ├── Dockerfile
│ ├── action.yml
│ └── entrypoint.sh
└── action2
├── Dockerfile
├── action.yml
└── entrypoint.sh
And here's a workflow in the same repo calling both actions in the same repo:
name: Test two actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./action1
- uses: ./action2
And here's a workflow in a different repo calling the actions:
name: Test two actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: managedkaos/github-actions-two-actions/action1@master
- uses: managedkaos/github-actions-two-actions/action2@master
If you're OK with not listing the actions in the GitHub Marketplace, just put the action.yml
file in the same dir as the action and you'll be fine!
For reference, you can find the code in these examples here: