diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index 6a8e5e8b46..a2fed13510 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -58,7 +58,7 @@ jobs: run: | # ISSUE=$(glab issue create -t "Update Heimdall to $1" -d="" --no-editor -y | cut -d/ -f10) # MR_NUMBER=$(glab mr create --allow-collaboration --fill --copy-issue-labels -i $ISSUE --push -y --squash-before-merge | awk -F '/' 'NR==2 {print $NF}') - ISSUE=$(curl -X POST --header "PRIVATE-TOKEN: ${{ secrets.REPO1_PAT_AMANN_MAXIMAL }}" --header "Content-Type: application/json" --data '{"title": "DRAFT: TESTTING ONLY DO NOT MERGE Update Heimdall to ${{ github.event.pull_request.head.sha }}"}' "https://repo1.dso.mil/api/v4/projects/${{ env.IRONBANK_HEIMDALL_PROJECT_ID }}/issues" | jq ".iid") # need to fix the title here and also swap out the commit hash + ISSUE=$(curl -X POST --header "PRIVATE-TOKEN: ${{ secrets.REPO1_PAT_AMANN_MAXIMAL }}" --header "Content-Type: application/json" --data '{"title": "DRAFT: TESTING ONLY DO NOT MERGE Update Heimdall to ${{ github.event.pull_request.head.sha }}"}' "https://repo1.dso.mil/api/v4/projects/${{ env.IRONBANK_HEIMDALL_PROJECT_ID }}/issues" | jq ".iid") # need to fix the title here and also swap out the commit hash git push 'https://amann:${{ secrets.REPO1_PAT_AMANN_MAXIMAL }}@repo1.dso.mil/dsop/mitre/security-automation-framework/heimdall2.git' "${{ github.event.pull_request.head.sha }}":"${ISSUE}-update-heimdall-to-${{ github.event.pull_request.head.sha }}" - curl -X POST --header "PRIVATE-TOKEN: ${{ secrets.REPO1_PAT_AMANN_MAXIMAL }}" --header "Content-Type: application/json" --data '{"allow_collaboration": true, "squash": true, "source_branch": "${ISSUE}-update-heimdall-to-${{ github.event.pull_request.head.sha }}", "target_branch": "development", "title": "Resolve \"DRAFT: TESTING ONLY DO NOT MERGE Update Heimdall to ${{ github.event.pull_request.head.sha }}\"", "description": "Closes #${ISSUE}"}' "https://repo1.dso.mil/api/v4/projects/${{ env.IRONBANK_HEIMDALL_PROJECT_ID }}/merge_requests" # gitsha doesn't need changing but when we want to convert a semver to replace periods with hyphens will probably need to replace the sha variable with this command `$(echo "$however_we_get_the_semver" | sed 's/[\. ]/-/g')` + curl -X POST --header "PRIVATE-TOKEN: ${{ secrets.REPO1_PAT_AMANN_MAXIMAL }}" --header "Content-Type: application/json" --data "{\"allow_collaboration\": true, \"squash\": true, \"source_branch\": \"${ISSUE}-update-heimdall-to-${{ github.event.pull_request.head.sha }}\", \"target_branch\": \"development\", \"title\": \"Resolve \\"DRAFT: TESTING ONLY DO NOT MERGE Update Heimdall to ${{ github.event.pull_request.head.sha }}\\"\", \"description\": \"Closes #${ISSUE}\"}" "https://repo1.dso.mil/api/v4/projects/${{ env.IRONBANK_HEIMDALL_PROJECT_ID }}/merge_requests" # gitsha doesn't need changing but when we want to convert a semver to replace periods with hyphens will probably need to replace the sha variable with this command `$(echo "$however_we_get_the_semver" | sed 's/[\. ]/-/g')` # need to 1) manually push local branch to upstream so that branch exists there, 2) make source_branch equal to that thing - maybe will require making the branch after making the issue so that i can grab the issue number?, 3) make the target branch exactly equal to 'development' but maybe i can use the api to get the default branch name which might be development?, 4) figure out how to do the substitution properly so that it'll put the actual issue number in there instead of the word ISSUE