Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CE-1043 investigate issue with pipeline image GitHub images appear to be deleted while in use #721

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
39 changes: 39 additions & 0 deletions .github/actions/get-latest-pr-number/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Get Latest Merged PR Number
description: Get the latest merged PR number from the release branch, this is the production candidate
branding:
icon: git-pull-request
color: blue

inputs:
token:
description: Specify token (GH or PAT), instead of inheriting one from the calling workflow
default: ${{ github.token }}

outputs:
pr:
description: "Latest merged pull request number"
value: ${{ steps.vars.outputs.pr }}

runs:
using: composite
steps:
- id: vars
shell: bash
run: |
git fetch origin

release_branch="${{ github.event.pull_request.head.ref }}"
echo "Detected release branch: $release_branch"

latest_pr=$(git log origin/$release_branch --pretty=format:'%s' | grep -oP '(?<=#)\d+' | head -n 1)

if [ -z "$latest_pr" ]; then
echo "No merged PR found on $release_branch"
exit 1
elif [[ ! "$latest_pr" =~ ^[0-9]+$ ]]; then
echo "PR number format incorrect: $latest_pr"
exit 1
fi

echo "Latest PR number from $release_branch: $latest_pr"
echo "pr=$latest_pr" >> $GITHUB_OUTPUT
11 changes: 5 additions & 6 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ jobs:
vars:
name: Set Variables
outputs:
pr: ${{ steps.pr.outputs.pr }}
pr: ${{ steps.latest-pr.outputs.pr }}
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
# Get PR number for squash merges to release
- name: PR Number
id: pr
uses: ./.github/actions/get-pr-number
- name: Get Latest PR Number in release branch
id: latest-pr
uses: ./.github/actions/get-latest-pr-number
- name: Set PR Output
run: echo "pr=${{ steps.pr.outputs.pr }}" >> $GITHUB_OUTPUT
run: echo "pr=${{ steps.latest-pr.outputs.pr }}" >> $GITHUB_OUTPUT

create_release:
name: Create GitHub Release (Keep Version)
Expand Down
Loading