This repository was archived by the owner on Apr 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.36 KB
/
Copy pathversion.yml
File metadata and controls
85 lines (71 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Version Packages
on:
workflow_dispatch:
inputs:
version_type:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
package:
description: 'Package to version (leave empty for all changed packages)'
required: false
type: string
permissions:
contents: write
pull-requests: write
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Create changeset
run: |
if [ -n "${{ github.event.inputs.package }}" ]; then
echo "Creating changeset for specific package: ${{ github.event.inputs.package }}"
cat > .changeset/version-bump.md << EOF
---
"${{ github.event.inputs.package }}": ${{ github.event.inputs.version_type }}
---
Manual version bump via GitHub Actions
EOF
else
echo "Creating changeset for all packages"
cat > .changeset/version-bump.md << EOF
---
"@taskade/eslint-plugin": ${{ github.event.inputs.version_type }}
---
Manual version bump via GitHub Actions
EOF
fi
- name: Apply version changes
run: npm run changeset:version
- name: Commit and create PR
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Create a new branch
BRANCH_NAME="changeset/version-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH_NAME"
# Add changes
git add .
git commit -m "chore: version packages (${{ github.event.inputs.version_type }})"
# Push branch
git push origin "$BRANCH_NAME"
# Create PR (requires gh CLI or use API)
echo "Branch $BRANCH_NAME created with version changes"
echo "Please create a PR manually or use the GitHub CLI to create one"