Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
003ec3de
Unverified
Commit
003ec3de
authored
1 year ago
by
Ryan Laurie
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve release commit check (#34550)
parent
e14c1ff8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/build-for-release.yml
+20
-21
20 additions, 21 deletions
.github/workflows/build-for-release.yml
with
20 additions
and
21 deletions
.github/workflows/build-for-release.yml
+
20
−
21
View file @
003ec3de
...
...
@@ -78,30 +78,29 @@ jobs:
uses
:
actions/checkout@v3
with
:
fetch-depth
:
0
# IMPORTANT! to get all the branches
-
name
:
Ensure that the specified commit exists in the latest release branch
env
:
COMMIT
:
${{ inputs.commit }}
sparse-checkout
:
release
-
name
:
Prepare build scripts
run
:
cd ${{ github.workspace }}/release && yarn && yarn build
-
name
:
Get Release Branch
uses
:
actions/github-script@v6
id
:
release_branch
with
:
result_encoding
:
string
script
:
|
# js
const { getReleaseBranch } = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
const releaseBranch = getReleaseBranch(version);
return releaseBranch;
-
name
:
Ensure that the specified commit exists in the ${{ steps.release_branch.outputs.result }} release branch
run
:
|
echo "Checking if the specified commit is in a release branch..."
git branch -a --contains $COMMIT > branches.txt
if [[ $(grep -c master branches.txt) =~ 1 ]]; then
echo "Found in master branch. ABORT!"
exit -1
fi
if [[ $(grep -c 'release-x' branches.txt) =~ 1 ]]; then
echo "Found the commit $COMMIT in:"
git branch -a --contains $COMMIT
echo "Proceeding to the next step..."
exit 0
else
echo "Commit $COMMIT is not found in a single release branch"
echo "ABORT!."
exit -1
fi
RELEASE_BRANCH=${{ steps.release_branch.outputs.result }}
git checkout $RELEASE_BRANCH
git branch --contains ${{ inputs.commit }} | grep -q $RELEASE_BRANCH \
&& echo "Commit found in correct release branch" \
|| (echo "Commit not found in correct release branch" && exit 1)
build-uberjar-for-release
:
needs
:
check-version
needs
:
[
check-version
,
check-commit
]
runs-on
:
ubuntu-22.04
timeout-minutes
:
50
strategy
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment