new workflow

This commit is contained in:
Amit Rajput 2025-11-27 18:15:45 +05:30
parent ddd5f59c18
commit 4aec3cdb78
3 changed files with 18 additions and 3 deletions

View File

@ -24,7 +24,17 @@ jobs:
TAG=`echo $ISSUE_COMMENT_STRING | jq -r ".tag"`
REPO=`echo $ISSUE_COMMENT_STRING | jq -r ".repo"`
SENDER=`echo $ISSUE_COMMENT_STRING | jq -r ".sender"`
DOCKER_REPO=${{ vars.docker_repo2_registry }}/$REPO
# Try to extract docker_repo from issue comment, fallback to default variable
DOCKER_REPO_FROM_COMMENT=`echo $ISSUE_COMMENT_STRING | jq -r ".docker_repo // empty"`
if [ -n "$DOCKER_REPO_FROM_COMMENT" ] && [ "$DOCKER_REPO_FROM_COMMENT" != "null" ]; then
DOCKER_REPO=$DOCKER_REPO_FROM_COMMENT
echo "Using docker_repo from issue comment: $DOCKER_REPO"
else
DOCKER_REPO=${{ vars.docker_repo2_registry }}/$REPO
echo "Using fallback docker_repo: $DOCKER_REPO"
fi
echo "TAG=$TAG" >> "$GITHUB_OUTPUT";
echo "REPO=$REPO" >> "$GITHUB_OUTPUT";
echo "SENDER=$SENDER" >> "$GITHUB_OUTPUT";

View File

@ -9,6 +9,10 @@ on:
description: 'The cs repo that contains this image'
required: true
type: string
docker_repo:
description: 'The name of the action variable containing the docker repo value'
required: false
type: string
jobs:
trigger-cs-job:
@ -32,7 +36,8 @@ jobs:
- name: Push image name and tag to cs repo's latest issue with label workflow
run: |
ISSUE_COMMENT_STRING=`echo "{ \"repo\": \"${{ steps.get-id.outputs.REPO }}\", \"tag\": \"${{ steps.get-id.outputs.TAG }}\", \"sender\": \"${{ github.event.sender.login }}\" }" | jq tostring`
DOCKER_REPO_VALUE="${{ vars[inputs.docker_repo] }}"
ISSUE_COMMENT_STRING=`echo "{ \"docker_repo\": \"$DOCKER_REPO_VALUE\", \"repo\": \"${{ steps.get-id.outputs.REPO }}\", \"tag\": \"${{ steps.get-id.outputs.TAG }}\", \"sender\": \"${{ github.event.sender.login }}\" }" | jq tostring`
echo ISSUE_COMMENT_STRING: $ISSUE_COMMENT_STRING
API_JSON_BODY=`echo '{"body": '$ISSUE_COMMENT_STRING' }' | jq -r tostring`

2
.gitignore vendored
View File

@ -129,4 +129,4 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.idea/