Last active
July 27, 2020 09:58
-
-
Save karancode/4ebf0aa6830ecd7d48c09c63736a30e9 to your computer and use it in GitHub Desktop.
Example workflow for using github action's residing in a private repo!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To use github actions from a private repo, you can clone the action's private repo locally in the workflow and execute it. | |
| # Below is an example workflow for reference! :) | |
| name: Private Action X | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| - release | |
| paths: | |
| - service/** | |
| jobs: | |
| private: | |
| name: Private Action X | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| # check the private action repo locally | |
| - name: Checkout Private Action repo | |
| uses: actions/checkout@v2 | |
| with: | |
| repository: YourOrg/Private-Action-Repo | |
| ref: v1.0.0 | |
| token: ${{ secrets.GITHUB_ACCESS_TOKEN }} # github access token with previleges to checkout the private action repo | |
| path: .github/actions/Private-action | |
| # use local path reference for executing the action | |
| - name: Private Action X | |
| uses: ./.github/actions/Private-action | |
| # PS: This is just a workaround as private actions are not (yet?) supported by Github! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment