-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
94 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 'PR Close' | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
jobs: | ||
merge_pr: | ||
name: 'PR Merged' | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ACCOUNT_WITH_FORCE_PUSH_PERMISSION_TOKEN }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
- name: Git config | ||
run: | | ||
git config --global user.email "${{ secrets.ACCOUNT_WITH_FORCE_PUSH_PERMISSION_EMAIL }}" | ||
git config --global user.name "${{ secrets.ACCOUNT_WITH_FORCE_PUSH_PERMISSION_NAME }}" | ||
- name: Apply version bump (major) | ||
if: contains(github.event.pull_request.labels.*.name, 'major') | ||
run: npm version major | ||
- name: Apply version bump (minor) | ||
if: contains(github.event.pull_request.labels.*.name, 'minor') | ||
run: npm version minor | ||
- name: Apply version bump (patch) | ||
if: contains(github.event.pull_request.labels.*.name, 'patch') | ||
run: npm version patch | ||
- name: Git push version bump | ||
run: git push origin main --follow-tags --force | ||
- id: set-version | ||
name: Output version change | ||
run: npm pkg get version |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Label Check' | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [labeled, unlabeled, synchronize] | ||
jobs: | ||
check_labels: | ||
name: 'Check PR Labels' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: mheap/github-action-required-labels@v5 | ||
with: | ||
mode: exactly | ||
count: 1 | ||
labels: 'major, minor, patch' | ||
add_comment: true | ||
message: "For merging ***one*** versioning label is required: ```major```, ```minor``` or ```patch```." |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 'PR Open' | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
jobs: | ||
check_labels: | ||
name: 'Check PR Labels' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
outputs: | ||
status: ${{ steps.labels.outputs.status }} | ||
steps: | ||
- id: labels | ||
uses: mheap/github-action-required-labels@v5 | ||
with: | ||
mode: exactly | ||
count: 1 | ||
labels: 'major, minor, patch' | ||
exit_type: success | ||
|
||
add_label: | ||
name: 'Add Default Label' | ||
needs: check_labels | ||
runs-on: ubuntu-latest | ||
if: needs.check_labels.outputs.status == 'failure' | ||
steps: | ||
- name: Add Default Label | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
labels: 'minor' |
This file was deleted.
Oops, something went wrong.
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