File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Create Release
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : " Release version (e.g. v1.2.3)"
8+ required : true
9+
10+ permissions :
11+ contents : write
12+
13+ jobs :
14+ create_release :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Enforce user permissions
21+ run : |
22+ ALLOWED_USERS=("piratekev" "gsgalloway")
23+ if [[ ! " ${ALLOWED_USERS[@]} " =~ " ${GITHUB_ACTOR} " ]]; then
24+ echo "❌ User $GITHUB_ACTOR is not allowed to run this workflow."
25+ exit 1
26+ fi
27+
28+ - name : Create Git tag
29+ run : |
30+ git config user.name "${{ github.actor }}"
31+ git config user.email "${{ github.actor }}@users.noreply.github.com"
32+ git tag v${{ github.event.inputs.version }}
33+ git push origin v${{ github.event.inputs.version }}
34+
35+ - name : Create GitHub Release
36+ uses : softprops/action-gh-release@v1
37+ with :
38+ tag_name : ${{ github.event.inputs.version }}
39+ name : Release ${{ github.event.inputs.version }}
40+ generate_release_notes : true
You can’t perform that action at this time.
0 commit comments