Version Packages #4
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
name: Version Packages | |
on: | |
workflow_run: | |
workflows: ["Build and Test"] | |
types: | |
- completed | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
packages: write | |
issues: write | |
pull-requests: write | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
version-packages: | |
name: Create Version PR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: Create Version PR | |
id: changesets | |
uses: changesets/action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print Version Status | |
run: | | |
if [[ "${{ steps.changesets.outputs.published }}" == "true" ]]; then | |
echo "✨ Version updates created" | |
echo "Updated packages: ${{ steps.changesets.outputs.publishedPackages }}" | |
else | |
echo "No version updates needed - skipping PR creation" | |
fi | |