Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

[Release step 1 | manual] Create Release PR #152

[Release step 1 | manual] Create Release PR

[Release step 1 | manual] Create Release PR #152

name: '[Release step 1 | manual] Create Release PR'
on:
schedule:
- cron: "0 16 * * 3"
repository_dispatch:
types: [prepare-release-command]
workflow_dispatch:
jobs:
validate-branch:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/5.x.x'
steps:
- name: Echo Valid Branches
run: |
echo "::error title=Invalid Target Branch::This action can only be triggered for branches 'main' or '5.x.x'"
exit 1
release-step-1_manual_create-release-pr:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/5.x.x'
steps:
- uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: One App release
id: vars
run: |
npm ci
git config --local user.email "[email protected]"
git config --local user.name "OneAmexBot"
npm run release
git add .
git commit -m "docs(changelog): update"
env:
NODE_ENV: development
HUSKY: 0
- name: Create release pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PA_TOKEN }}
commit-message: One App Prepare Release
author: 'OneAmexBot <[email protected]>'
title: 'One App Prepare Release (${{ github.ref_name }})'
body: 'This is an auto-generated pull request for One App release changes. Please review this PR and merge it for a release to be initiated. Please close this PR to stop a release from being initiated.'
labels: release,automated pr,skip-release-drafter
branch: ${{ format('prepare-release-for-{0}', github.ref_name)}}