Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ jobs:
uses: open-telemetry/opentelemetry-python-contrib/.github/workflows/core_contrib_test_0.yml@main
with:
CORE_REPO_SHA: ${{ github.sha }}
CONTRIB_REPO_SHA: main
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
10 changes: 9 additions & 1 deletion .github/workflows/lint_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
PIP_EXISTS_ACTION: w

jobs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
PIP_EXISTS_ACTION: w

jobs:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
run: .github/scripts/use-cla-approved-github-bot.sh

- name: Create pull request
id: create_pr
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
Expand All @@ -74,7 +75,15 @@ jobs:

git commit -a -m "$message"
git push origin HEAD:$branch
gh pr create --title "[$GITHUB_REF_NAME] $message" \
pr_url=$(gh pr create --title "[$GITHUB_REF_NAME] $message" \
--body "$message." \
--head $branch \
--base $GITHUB_REF_NAME
--base $GITHUB_REF_NAME)

echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
- name: Add prepare-release label to PR
if: steps.create_pr.outputs.pr_url != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ steps.create_pr.outputs.pr_url }} --add-label "prepare-release"
26 changes: 22 additions & 4 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
run: .github/scripts/use-cla-approved-github-bot.sh

- name: Create pull request against the release branch
id: create_release_branch_pr
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
Expand All @@ -100,10 +101,18 @@ jobs:

git commit -a -m "$message"
git push origin HEAD:$branch
gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
pr_url=$(gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
--body "$message." \
--head $branch \
--base $RELEASE_BRANCH_NAME
--base $RELEASE_BRANCH_NAME)
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT

- name: Add prepare-release label to PR
if: steps.create_release_branch_pr.outputs.pr_url != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ steps.create_release_branch_pr.outputs.pr_url }} --add-label "prepare-release"

create-pull-request-against-main:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -170,6 +179,7 @@ jobs:
run: .github/scripts/use-cla-approved-github-bot.sh

- name: Create pull request against main
id: create_main_pr
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
Expand All @@ -180,7 +190,15 @@ jobs:

git commit -a -m "$message"
git push origin HEAD:$branch
gh pr create --title "$message" \
pr_url=$(gh pr create --title "$message" \
--body "$body" \
--head $branch \
--base main
--base main)
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT

- name: Add prepare-release label to PR
if: steps.create_main_pr.outputs.pr_url != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr edit ${{ steps.create_main_pr.outputs.pr_url }} --add-label "prepare-release"
10 changes: 9 additions & 1 deletion .github/workflows/templates/lint.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}{% endraw %}
PIP_EXISTS_ACTION: w

jobs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/templates/misc.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}{% endraw %}
PIP_EXISTS_ACTION: w

jobs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/templates/test.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}{% endraw %}
PIP_EXISTS_ACTION: w

jobs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
PIP_EXISTS_ACTION: w

jobs:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ concurrency:

env:
CORE_REPO_SHA: main
CONTRIB_REPO_SHA: main
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
# For PRs you can change the inner fallback ('main')
# For pushes you change the outer fallback ('main')
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
'main'
) || 'main' }}
PIP_EXISTS_ACTION: w

jobs:
Expand Down