Skip to content

Commit

Permalink
ci: add version bump, auto labeling of pr
Browse files Browse the repository at this point in the history
ci: change git trigger event to pull_request
  • Loading branch information
DeepakBomjan committed Aug 24, 2023
1 parent dd745f7 commit af431b2
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cicd:
- '.github/workflows/*'

scripts:
- 'scripts/*'

test:
- 'test/**'

documentation:
- '**/*.md'
33 changes: 33 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Bump version
on:
push:
branches:
- "**"
# pull_request:
# types:
# - closed
# branches:
# - master

jobs:
build:
# if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'

- name: Bump version and push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INITIAL_VERSION: 0.1.0
WITH_V: true
PRERELEASE: true
DEFAULT_BUMP: none
PRERELEASE_SUFFIX: alpha

16 changes: 16 additions & 0 deletions .github/workflows/check-version-bump-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check version-bump label
on:
pull_request:
branches:
- "main"
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
require-version-bump-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
labels: "bump:patch, bump:minor, bump:major, bump:none"
38 changes: 38 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Pull Request Labeler
on:
pull_request:
branches:
- "**"
paths:
- ".github/workflows/labeler.yml"
- ".github/labeler.yml"
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
auto-label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Find Current Pull Request
uses: jwalton/[email protected]
id: findPr
with:
# Can be "open", "closed", or "all". Defaults to "open".
state: open
- run: echo "PR Number is ${PR}"
if: success() && steps.findPr.outputs.number
env:
PR: ${{ steps.findPr.outputs.pr }}

- name: check pr pr-number
run: echo ${{ github.event.number }}

- uses: actions/labeler@v4
with:
dot: true
pr-number: ${{ steps.findPr.outputs.pr }}
2 changes: 1 addition & 1 deletion xCall
Submodule xCall updated from 17555e to b4ec95

0 comments on commit af431b2

Please sign in to comment.