fix: use first commit message as PR title in auto-pr workflow (#7) #5
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: Release Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release-please: | |
| # Skip on template repository to prevent unnecessary releases | |
| # This workflow activates automatically when you use the template | |
| if: github.repository != 'gander-templates/node-project-starter' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| version: ${{ steps.release.outputs.version }} | |
| steps: | |
| - name: Run Release Please | |
| id: release | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| release-type: node | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Release Summary | |
| if: steps.release.outputs.release_created | |
| run: | | |
| { | |
| echo "## 🎉 Release Created!" | |
| echo "" | |
| echo "- **Version:** ${{ steps.release.outputs.version }}" | |
| echo "- **Tag:** ${{ steps.release.outputs.tag_name }}" | |
| echo "- **Release URL:** ${{ steps.release.outputs.html_url }}" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| publish-npm: | |
| needs: release-please | |
| if: needs.release-please.outputs.release_created | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Build package | |
| run: npm run build | |
| - name: Validate package with publint | |
| run: npx publint --strict | |
| - name: Publish to NPM with provenance | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create tarball | |
| run: npm pack | |
| - name: Upload tarball to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.release-please.outputs.tag_name }} | |
| files: | | |
| *.tgz | |
| - name: Generate SLSA provenance | |
| uses: slsa-framework/slsa-github-generator@v2.0.0 | |
| with: | |
| artifact-path: ./dist | |
| provenance-name: provenance.intoto.jsonl | |
| - name: NPM Publish Summary | |
| run: | | |
| { | |
| echo "## 📦 NPM Package Published!" | |
| echo "" | |
| echo "- **Package:** @gander-templates/node-project-starter" | |
| echo "- **Version:** ${{ needs.release-please.outputs.version }}" | |
| echo "- **NPM URL:** https://www.npmjs.com/package/@gander-templates/node-project-starter/v/${{ needs.release-please.outputs.version }}" | |
| echo "- **Provenance:** Enabled ✅" | |
| echo "- **SLSA Attestation:** Generated ✅" | |
| } >> "$GITHUB_STEP_SUMMARY" |