Skip to content

Commit

Permalink
Use CI_ACCESS_TOKEN to create release PR (#5286)
Browse files Browse the repository at this point in the history
## Problem

If @github-actions creates release PR, the CI pipeline is not triggered
(but we have `release-notify.yml` workflow that we expect to run on this
event).
I suspect this happened because @github-actions is not a repository
member.

Ref
#5283 (comment)

## Summary of changes
- Use `CI_ACCESS_TOKEN` to create a PR
- Use `gh` instead of `thomaseizinger/create-pull-request`
- Restrict permissions for GITHUB_TOKEN to `contents: write` only
(required for `git push`)
  • Loading branch information
bayandin authored Sep 12, 2023
1 parent e1661c3 commit 2641ff3
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ on:

jobs:
create_release_branch:
runs-on: [ubuntu-latest]
runs-on: [ ubuntu-latest ]

permissions:
contents: write # for `git push`

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand All @@ -26,9 +29,16 @@ jobs:
run: git push origin releases/${{ steps.date.outputs.date }}

- name: Create pull request into release
uses: thomaseizinger/create-pull-request@e3972219c86a56550fb70708d96800d8e24ba862 # 1.3.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
head: releases/${{ steps.date.outputs.date }}
base: release
title: Release ${{ steps.date.outputs.date }}
env:
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
run: |
cat << EOF > body.md
## Release ${{ steps.date.outputs.date }}
**Please merge this PR using 'Create a merge commit'!**
EOF
gh pr create --title "Release ${{ steps.date.outputs.date }}" \
--body-file "body.md" \
--head "releases/${{ steps.date.outputs.date }}" \
--base "release"

1 comment on commit 2641ff3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2534 tests run: 2414 passed, 1 failed, 119 skipped (full report)


Failures on Postgres 14

  • test_delete_tenant_exercise_crash_safety_failpoints[Check.RETRY_WITH_RESTART-real_s3-timeline-delete-before-index-deleted-at-False]: release
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_delete_tenant_exercise_crash_safety_failpoints[release-pg14-Check.RETRY_WITH_RESTART-real_s3-timeline-delete-before-index-deleted-at-False]"
Flaky tests (6)

Postgres 16

  • test_partial_evict_tenant: release, debug
  • test_get_tenant_size_with_multiple_branches: release

Postgres 14

  • test_download_remote_layers_api[local_fs]: debug
  • test_get_tenant_size_with_multiple_branches: release, debug

Test coverage report is not available

The comment gets automatically updated with the latest test results
2641ff3 at 2023-09-12T19:41:47.920Z :recycle:

Please sign in to comment.