Skip to content

Commit e445dd1

Browse files
committed
added: 📝 example reference to the readme
1 parent ef4f6e6 commit e445dd1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
# Shared Workflows
22

33
> Shared [Reusable GitHub Workflows](https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#overview) for my projects
4+
5+
## Usage
6+
7+
To use the shared workflow, you need to use the `uses` keyword when referring to a `job` in the workflow. As an example: `jobs.<job_id>.uses`.
8+
9+
Here is an example workflow file:
10+
11+
```yaml
12+
name: Publish NPM Package
13+
14+
on:
15+
push:
16+
branches:
17+
- main
18+
workflow_dispatch:
19+
20+
jobs:
21+
npm-publish:
22+
uses: devshareacademy/shared-workflows/.github/workflows/publish-package.yml@main
23+
secrets:
24+
npm_token: ${{ secrets.NPM_TOKEN }}
25+
gh_token: ${{ secrets.GH_TOKEN }}
26+
```
27+
28+
*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).

0 commit comments

Comments
 (0)