-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added: 📝 example reference to the readme
- Loading branch information
1 parent
ef4f6e6
commit e445dd1
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.<job_id>.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). |