Shared Reusable GitHub Workflows for my projects
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:
name: Publish NPM Package
on:
push:
branches:
- main
workflow_dispatch:
jobs:
npm-publish:
uses: devshareacademy/shared-workflows/.github/workflows/publish-package.yml@v1.0.0
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.