Skip to content

Commit

Permalink
don't repeat remote twice and also try wrapping the variable in brace…
Browse files Browse the repository at this point in the history
…s so that maybe the shell expansion happens

Signed-off-by: Amndeep Singh Mann <[email protected]>
  • Loading branch information
Amndeep7 committed Dec 27, 2024
1 parent fa7e94e commit 228ecb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push-lite-to-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ jobs:
# 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
git push 'https://amann:${{ secrets.REPO1_PAT_AMANN_MAXIMAL }}@repo1.dso.mil/dsop/mitre/security-automation-framework/heimdall2.git' origin "${{ 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: TESTTING 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')`
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')`
# 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

0 comments on commit 228ecb8

Please sign in to comment.