Skip to content

Commit

Permalink
build(gha): update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Sep 29, 2023
1 parent 988c546 commit e185344
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/pull-request-open.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Assign pull request author'

on:
pull_request:
types:
- opened

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
assign-author:
runs-on: ubuntu-22.04
steps:
- uses: myparcelnl/actions/pr-assign-author@v3
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/pull-request-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Label pull request'

on:
pull_request_review:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}

jobs:
label:
runs-on: ubuntu-22.04
steps:
- uses: myparcelnl/actions/pr-label-by-review@v3
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
label-approved: 'approved'
label-changes-requested: 'changes requested'
protection-type: 'rulesets'
20 changes: 20 additions & 0 deletions .github/workflows/pull-request-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Lint pull request title'

on:
pull_request:
types:
- opened
- edited

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: myparcelnl/actions/pr-validate-title-conventional@v3
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}
29 changes: 29 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,32 @@ jobs:
test:
uses: ./.github/workflows/test.yml
secrets: inherit

build:
runs-on: ubuntu-22.04
needs:
- test
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- uses: ./.github/actions/build
id: build
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}

- name: 'Determine version'
id: version
#language=sh
run: |
version=$(npm pkg get version | sed 's/"//g')
releaseVersion="$version-${{ github.event.pull_request.number}}.${{ github.event.pull_request.head.sha }}"
echo "version=$releaseVersion" >> $GITHUB_OUTPUT
- uses: ./.github/actions/release
id: release
with:
version: ${{ steps.version.outputs.version }}
29 changes: 29 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,35 @@ jobs:
uses: ./.github/workflows/test.yml
secrets: inherit

build:
runs-on: ubuntu-22.04
needs:
- test
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- uses: ./.github/actions/build
id: build
with:
app-id: ${{ secrets.MYPARCEL_APP_ID }}
private-key: ${{ secrets.MYPARCEL_APP_PRIVATE_KEY }}

- name: 'Determine version'
id: version
#language=sh
run: |
version=$(npm pkg get version | sed 's/"//g')
releaseVersion="$version-${{ github.sha }}"
echo "version=$releaseVersion" >> $GITHUB_OUTPUT
- uses: ./.github/actions/release
id: release
with:
version: ${{ steps.version.outputs.version }}

rebase-prs:
needs:
- test
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: '🚀 Release'

on:
push:
branches:
- main
- develop

workflow_dispatch:

concurrency:
Expand Down

0 comments on commit e185344

Please sign in to comment.