Skip to content

Commit

Permalink
Automatically add backport labels for release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Aug 10, 2024
1 parent 5ec1a46 commit cee2740
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .ci/scripts/create_release_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ git add docs/versions.txt
bump-my-version bump minor --commit --message $'Bump version to {new_version}' --allow-dirty

git push origin "${NEW_BRANCH}"

if [ "${GITHUB_ENV:-}" ]
then
echo "NEW_BRANCH=${NEW_BRANCH}" >> "${GITHUB_ENV}"
fi
2 changes: 1 addition & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
single_commit:
apply_labels:
runs-on: "ubuntu-latest"
name: "Label PR"
permissions:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ jobs:
body: ""
branch: "bump_version"
delete-branch: true
- name: "Add Backport Label for new Branch"
uses: "actions/github-script@v7"
with:
script: |
const { NEW_BRANCH } = process.env;
const labelName = "backport-" + NEW_BRANCH;
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
color: "C8780A",
});
...
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ git add docs/versions.txt
bump-my-version bump minor --commit --message $'Bump version to {new_version}' --allow-dirty

git push origin "${NEW_BRANCH}"

if [ "${GITHUB_ENV:-}" ]
then
echo "NEW_BRANCH=${NEW_BRANCH}" >> "${GITHUB_ENV}"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
single_commit:
apply_labels:
runs-on: "ubuntu-latest"
name: "Label PR"
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ jobs:
body: ""
branch: "bump_version"
delete-branch: true
- name: "Add Backport Label for new Branch"
uses: "actions/github-script@v7"
with:
script: |
const { NEW_BRANCH } = process.env;
const labelName = "backport-" + NEW_BRANCH;
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
color: "C8780A",
});
...
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lint requirements
black==24.8.0
flake8==7.1.0
flake8==7.1.1
flake8-pyproject==1.2.3
isort==5.13.2
mypy==1.11.1
Expand Down

0 comments on commit cee2740

Please sign in to comment.