Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drupal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitLab CI/CD
Drupal
Commits
7a8a76a0
Commit
7a8a76a0
authored
3 years ago
by
Jürgen Haas
Browse files
Options
Downloads
Patches
Plain Diff
Add template to create a MR with proposed changes if a build process creates modifications
parent
738b438d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/mr-proposed-changes.sh
+2
-6
2 additions, 6 deletions
scripts/mr-proposed-changes.sh
with
2 additions
and
6 deletions
scripts/mr-proposed-changes.sh
+
2
−
6
View file @
7a8a76a0
...
...
@@ -19,8 +19,7 @@ SOURCE_BRANCH=${TARGET_BRANCH}-proposed-update-$(date +%Y-%m-%d-%H-%M-%S)
# Extract the host where the server is running, and add the URL to the APIs
[[
$HOST
=
~ ^https?://[^/]+
]]
&&
HOST
=
"
${
BASH_REMATCH
[0]
}
/api/v4/projects/"
# The description of our new MR, we want to remove the branch after the MR has
# been closed
# The description of our new MR, we want to remove the branch after the MR has been closed
BODY
=
"{
\"
id
\"
:
${
CI_PROJECT_ID
}
,
\"
source_branch
\"
:
\"
${
SOURCE_BRANCH
}
\"
,
...
...
@@ -35,16 +34,13 @@ git config --global user.email "${GITLAB_USER_EMAIL}"
git config
--global
user.name
"
${
GITLAB_USER_NAME
}
"
git remote add mr
${
REPO
}
git fetch mr
git pull mr
git branch
${
SOURCE_BRANCH
}
git checkout
${
SOURCE_BRANCH
}
git commit
-am
"GitLab CI proposed changes"
git push
-u
mr
${
SOURCE_BRANCH
}
git checkout
${
TARGET_BRANCH
}
git branch
-d
${
SOURCE_BRANCH
}
git remote remove mr
echo
curl
-X
POST
"
${
HOST
}${
CI_PROJECT_ID
}
/merge_requests"
\
curl
-X
POST
"
${
HOST
}${
CI_PROJECT_ID
}
/merge_requests"
\
--header
"PRIVATE-TOKEN:
${
ACCESS_TOKEN
}
"
\
--header
"Content-Type: application/json"
\
--data
"
${
BODY
}
"
;
...
...
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