Skip to content
Snippets Groups Projects
Verified Commit 81d7435f authored by Timm Fitschen's avatar Timm Fitschen
Browse files

PIPELINE: switch to commits API

parent c9f7ca61
No related branches found
No related tags found
No related merge requests found
Pipeline #31548 failed
......@@ -17,12 +17,10 @@ add-commit:
- echo "test" >> test.tsv
- PRIVATE_TOKEN_HEADER='PRIVATE-TOKEN:'
- CONTENT_TYPE_HEADER='Content-Type:'
- BRANCH='"branch":'
- AUTHOR_EMAIL='"author_email":'
- AUTHOR_NAME='"author_name":'
- CONTENT='"content":'
- COMMIT_MESSAGE='"commit_message":'
- curl --fail-with-body --request PUT --header "$PRIVATE_TOKEN_HEADER $CIPRIVATETOKEN" --header "$CONTENT_TYPE_HEADER application/json" --data "{$BRANCH \"main\", $AUTHOR_EMAIL \"author@example.com\", $AUTHOR_NAME \"Ms C. I. Pipeline\", $CONTENT \"$(cat test.tsv)\", $COMMIT_MESSAGE \"update test.tsv\"}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/files/test%2Etsv"
- echo '{"branch": "main", "commit_message": "new commit via ci pipeline", "actions": [ { "action": "update", "file_path": "test.tsv", "encoding": "base64", "content": "' > commit.json
- base64 test.tsv >> commit.json
- echo '" } ] }' >> commit.json
- curl --fail-with-body --request POST --header "$PRIVATE_TOKEN_HEADER $CIPRIVATETOKEN" --header "$CONTENT_TYPE_HEADER application/json" --data "$(cat commit.json)" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/commits"
pages:
rules:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment