Skip to content

Commit ef0d38f

Browse files
chore: Merge pull request #7 from Mateo-Jimenez76/Mateo-Jimenez76-patch-1
chore: Update changelog workflow to include pull request creation
2 parents cf8582c + 66bb101 commit ef0d38f

2 files changed

Lines changed: 36 additions & 15 deletions

File tree

.github/workflows/changelog.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,47 @@ jobs:
1010
build:
1111
permissions:
1212
contents: write
13-
13+
pull-requests: write
14+
1415
runs-on: ubuntu-latest
1516

1617
steps:
17-
# Step 1: Check out your repository's code
1818
- name: Checkout Code
1919
uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222

23-
# Step 2: Generate the changelog
2423
- name: Generate Changelog
24+
id: changelog
2525
uses: TriPSs/conventional-changelog-action@v5
2626
with:
2727
github-token: ${{ secrets.GITHUB_TOKEN }}
2828
output-file: "CHANGELOG.md"
2929
preset: 'angular'
30-
#point to custom config file
31-
#config-file-path: "./changelog-config.js"
32-
30+
git-push: 'false'
3331

34-
# Step 3: Commit and push the updated CHANGELOG.md
35-
- name: Commit Updated Changelog
36-
uses: stefanzweifel/git-auto-commit-action@v5
32+
- name: Create Pull Request
33+
# This step only runs if the changelog action created a new version
34+
if: steps.changelog.outputs.skipped == 'false'
35+
uses: auto-pr/easy-pull-request@v1
3736
with:
38-
commit_message: "chore(docs): update CHANGELOG.md [skip ci]"
39-
file_pattern: "CHANGELOG.md"
37+
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
40+
# The name of the new branch to create
41+
branch: 'changelog/release-v${{ steps.changelog.outputs.version }}'
42+
43+
# The branch to merge into
44+
base_branch: 'main'
45+
46+
# The title of the pull request
47+
title: 'chore(release): v${{ steps.changelog.outputs.version }}'
48+
49+
# The commit message to use
50+
commit_message: 'chore(release): v${{ steps.changelog.outputs.version }}'
51+
52+
# The body of the pull request, using the changelog output
53+
body: |
54+
Automated release PR for v${{ steps.changelog.outputs.version }}.
55+
56+
${{ steps.changelog.outputs.changelog }}

.github/workflows/unity-tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ on:
1010
jobs:
1111
checkChangedFiles:
1212
runs-on: ubuntu-latest
13-
13+
outputs: # <--- 1. DEFINE JOB OUTPUTS HERE
14+
csharp_files_changed: ${{ steps.changed-csharp-files.outputs.any_changed }}
1415
steps:
1516
- name: Checkout code
1617
uses: actions/checkout@v4
17-
with:
18-
path: ${{ env.PROJECT_PATH }}
1918

2019
- name: Get all changed csharp files
2120
id: changed-csharp-files
@@ -38,12 +37,17 @@ jobs:
3837
name: Run Runtime Tests
3938
runs-on: ubuntu-latest
4039
needs: [checkChangedFiles]
41-
if: steps.changed-csharp-files.outputs.any_changed == 'true'
40+
if: needs.checkChangedFiles.outputs.csharp_files_changed == 'true'
4241
env:
4342
PROJECT_PATH: 'my-package'
4443
UNITY_VERSION: '6000.2.8f1'
4544

4645
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
with:
49+
path: ${{ env.PROJECT_PATH }}
50+
4751
- name: Cache Unity Library
4852
uses: actions/cache@v4
4953
with:

0 commit comments

Comments
 (0)