Skip to content

Commit

Permalink
fix: Adjustments in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra committed Oct 10, 2023
1 parent e75d099 commit 5b906ae
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/create_webclient_beta_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create PR on WebClient on Alpha Prerelease

on:
release:
types: [published]

jobs:
create-pr:
env:
TARGET_BRANCH: develop # This sets the variable for the branch
if: github.event.release.prerelease == true && startsWith(github.event.release.tag_name, 'v') && contains(github.event.release.tag_name, '-beta.')
runs-on: ubuntu-latest

steps:
- name: Checkout webclient repository
uses: actions/checkout@v2
with:
repository: '@gisce/webclient'
ref: ${{ env.TARGET_BRANCH }}
token: ${{ secrets.GH_PAT }}

- name: Update library version in package.json
run: |
sed -i 's/"@gisce/react-ooui": "[^"]*"/"@gisce/react-ooui": "${{ github.event.release.tag_name }}"/' package.json
- name: Install npm dependencies and generate package-lock.json
run: |
npm install
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GH_PAT }}
commit-message: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}"
title: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}"
branch: "update-react-ooui-${{ github.event.release.tag_name }}"
36 changes: 36 additions & 0 deletions .github/workflows/create_webclient_release_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create PR on WebClient on Alpha Prerelease

on:
release:
types: [published]

jobs:
create-pr:
env:
TARGET_BRANCH: alpha # This sets the variable for the branch
if: github.event.release.prerelease == false
runs-on: ubuntu-latest

steps:
- name: Checkout webclient repository
uses: actions/checkout@v2
with:
repository: '@gisce/webclient'
ref: ${{ env.TARGET_BRANCH }}
token: ${{ secrets.GH_PAT }}

- name: Update library version in package.json
run: |
sed -i 's/"@gisce/react-ooui": "[^"]*"/"@gisce/react-ooui": "${{ github.event.release.tag_name }}"/' package.json
- name: Install npm dependencies and generate package-lock.json
run: |
npm install
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GH_PAT }}
commit-message: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}"
title: "Update @gisce/react-ooui to ${{ github.event.release.tag_name }}"
branch: "update-react-ooui-${{ github.event.release.tag_name }}"

0 comments on commit 5b906ae

Please sign in to comment.