Publish examples (presets) #202
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 examples (presets) | |
| on: | |
| schedule: | |
| - cron: "0 16 1/2 * *" | |
| workflow_dispatch: | |
| workflow_call: | |
| permissions: {} | |
| jobs: | |
| examples: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'gh-metrics/metrics' | |
| permissions: | |
| contents: write # Commit and push generated preset examples. | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6.0.0 | |
| with: | |
| node-version: 20 | |
| cache: "npm" | |
| - name: Setup metrics | |
| run: npm ci --ignore-scripts --no-audit --no-fund | |
| - name: Publish presets examples | |
| # zizmor: ignore[use-trusted-publishing] This publishes generated files to Git, not an npm package. | |
| run: npm run presets -- publish | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |