Publish to GitHub Packages #2
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
| name: Publish to GitHub Packages | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish-github-packages: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://npm.pkg.github.com" | |
| cache: "npm" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Python dependencies | |
| run: node scripts/run_python.mjs -m pip install --disable-pip-version-check -r skills/omv-report/scripts/requirements.txt | |
| - name: Validate and build | |
| run: npm run validate | |
| - name: Pack and re-scope for GitHub Packages | |
| run: | | |
| npm pack | |
| mkdir -p /tmp/oh-my-vul-github | |
| tar -xzf oh-my-vul-*.tgz -C /tmp/oh-my-vul-github | |
| cd /tmp/oh-my-vul-github/package | |
| npm pkg set name=@bx33661/oh-my-vul | |
| npm pkg set publishConfig.registry=https://npm.pkg.github.com | |
| - name: Publish to GitHub Packages | |
| working-directory: /tmp/oh-my-vul-github/package | |
| run: npm publish --ignore-scripts | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |