Skip to content

Commit 3c4d1fc

Browse files
committed
chore: fix release PR action
1 parent 739ec47 commit 3c4d1fc

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
token: "${{ secrets.RENKUBOT_GITHUB_TOKEN }}"
1818
ref: 'develop'
1919
- uses: actions/setup-node@v3
20+
- name: Create Branch
21+
run: git checkout -b "release/v${{ github.event.inputs.version }}"
2022
- name: Merge Master
2123
run: git merge origin/master
2224
- name: Install dependencies
@@ -41,6 +43,14 @@ jobs:
4143
- name: Update Values file version
4244
run: |
4345
yq eval -i '.versions.latest.image.tag = "v${{ github.event.inputs.version }}"' helm-chart/renku-core/values.yaml
46+
- name: commit changes
47+
run: |
48+
git config --global --add user.name "Renku Bot"
49+
git config --global --add user.email "[email protected]"
50+
git config push.autoSetupRemote true
51+
git add helm-chart/renku-core/values.yaml helm-chart/renku-core/Chart.yaml renku/version.py CHANGES.rst
52+
git commit -m "chore: release v${{ github.event.inputs.version }}"
53+
git push
4454
- uses: ncipollo/release-action@v1
4555
with:
4656
token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
@@ -50,12 +60,25 @@ jobs:
5060
name: "v${{ github.event.inputs.version }}"
5161
commit: "master"
5262
- name: Create Pull Request
53-
uses: peter-evans/create-pull-request@v4
63+
uses: actions/github-script@v6
5464
with:
55-
token: "${{ secrets.RENKUBOT_GITHUB_TOKEN }}"
56-
add-paths: "CHANGES.rst,renku/version.py,helm-chart/renku-core/Chart.yaml,helm-chart/renku-core/values.yaml"
57-
commit-message: "chore: release v${{ github.event.inputs.version }}"
58-
branch: "release/v${{ github.event.inputs.version }}"
59-
base: "master"
60-
title: "chore: release v${{ github.event.inputs.version }}"
61-
body: "/deploy"
65+
token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
66+
script: |
67+
const { repo, owner } = context.repo;
68+
const result = await github.rest.pulls.create({
69+
title: 'chore: release v${{ github.event.inputs.version }}',
70+
owner,
71+
repo,
72+
head: 'release/v${{ github.event.inputs.version }}',
73+
base: 'master',
74+
body: [
75+
'This PR is auto-generated by',
76+
'[actions/github-script](https://github.com/actions/github-script).'
77+
].join('\n')
78+
});
79+
github.rest.issues.addLabels({
80+
owner,
81+
repo,
82+
issue_number: result.data.number,
83+
labels: ['feature', 'automated pr']
84+
});

0 commit comments

Comments
 (0)