Skip to content

Commit 951804d

Browse files
authored
Fix backwards compatibility data generation CI job to not include commits from release (#271)
1 parent c6a13be commit 951804d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/build-wheels.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,29 @@ jobs:
4949
# Generate data.
5050
python backwards-compatibility-data/generate_data.py $release_tag
5151
52-
# Push this data to a new branch and create a PR from it.
52+
# Fetch.
5353
git fetch
54+
55+
# Create a new branch for the changes.
5456
branch_name="update-backwards-compatibility-data-${release_tag}"
55-
echo $branch_name
5657
git checkout -b "$branch_name"
58+
59+
# Stage all changes within backwards-compatibility-data/data/.
5760
git add backwards-compatibility-data/data/
61+
62+
# Commit the staged changes.
5863
git commit -m "[automated] Update backwards-compatibility-data for release $release_tag"
64+
65+
# Reset other changes to match main branch - we do this in case the release branch had commits that were not in main.
66+
git reset --hard main
67+
68+
# Re-apply the commit with the backwards-compatibility-data changes.
69+
git cherry-pick HEAD@{1}
70+
71+
# Push to the branch.
5972
git push origin "$branch_name"
73+
74+
# Create a PR from this new branch to main.
6075
gh pr create --base main --head "$branch_name" --title "[automated] Update backwards-compatibility-data for release $release_tag" --body "This PR contains backwards compatibility indexes generated for release $release_tag."
6176
env:
6277
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)