From e445dd18c8f8f5c47efbb7e7349fdc7ebbdaaf95 Mon Sep 17 00:00:00 2001 From: Scott Westover Date: Tue, 23 Nov 2021 12:38:42 -0500 Subject: [PATCH] added: :memo: example reference to the readme --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 953fa61..bf0d5df 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ # Shared Workflows > Shared [Reusable GitHub Workflows](https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#overview) for my projects + +## Usage + +To use the shared workflow, you need to use the `uses` keyword when referring to a `job` in the workflow. As an example: `jobs..uses`. + +Here is an example workflow file: + +```yaml +name: Publish NPM Package + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + npm-publish: + uses: devshareacademy/shared-workflows/.github/workflows/publish-package.yml@main + secrets: + npm_token: ${{ secrets.NPM_TOKEN }} + gh_token: ${{ secrets.GH_TOKEN }} +``` + +*Note:* For more information on calling a reusable workflow, please see the following: [Calling Reusable Workflows](https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow).