-
Notifications
You must be signed in to change notification settings - Fork 1.2k
60 lines (49 loc) · 2.2 KB
/
create_rc_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Create RC PR
on:
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
create_rc_pr:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Install python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.11
cache: "pip"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tasks/libs/requirements-github.txt
- name: Determine the release active branch
run: |
echo "RELEASE_BRANCH=$(inv -e release.get-active-release-branch)" >> $GITHUB_ENV
- name: Checkout release branch
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ env.RELEASE_BRANCH }}
fetch-depth: 0
- name: Check for changes since last RC
id: check_for_changes
run: |
last_rc_commit=$(git log -1 --format=%H --grep="Update release.json and Go modules")
count=$(git rev-list --count HEAD ^"$last_rc_commit")
echo COUNT=$count >> $GITHUB_OUTPUT
if [ $count -eq '0' ]; then
echo "No changes since last RC. Quitting workflow."
else
echo "$count new commits found since last RC. Proceeding with the RC PR creation."
fi
- name: Create RC PR
if: ${{ steps.check_for_changes.outputs.COUNT != '0'}}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch
inv -e release.create-rc --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }}