File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed
Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,19 @@ jobs:
2424 - name : Set a ID based on the branch name
2525 id : set_environment_id
2626 run : |
27- JIRA_TICKET=$(echo '${{ github.event.pull_request.head.ref }}' | grep -Po --color=none '[A-z]{3,4}-[0-9]{3,5}' | tr '[:upper:]' '[:lower:]' || true)
28- BRANCH_HASH=$(echo '${{ github.event.pull_request.head.ref }}' | sha256sum | head -c 6)
27+ JIRA_TICKET=$(
28+ echo '${{ github.event.pull_request.head.ref }}' | \
29+ grep -Po --color=none '[A-z]{3,4}-[0-9]{3,5}' | \
30+ sed 's/-//g' | \
31+ tr '[:upper:]' '[:lower:]' || \
32+ true
33+ )
34+ BRANCH_HASH=$(echo '${{ github.event.pull_request.head.ref }}${{ github.event.pull_request.id }}' | sha256sum | head -c 6)
2935
3036 if [ -z "$JIRA_TICKET" ]; then
31- echo "environment_id=pr- ${BRANCH_HASH}" > $GITHUB_OUTPUT
37+ echo "environment_id=${BRANCH_HASH}" > $GITHUB_OUTPUT
3238 else
33- echo "environment_id=pr- ${JIRA_TICKET}-${BRANCH_HASH}" > $GITHUB_OUTPUT
39+ echo "environment_id=${JIRA_TICKET}-${BRANCH_HASH}" > $GITHUB_OUTPUT
3440 fi
3541 outputs :
3642 environment_id : ${{ steps.set_environment_id.outputs.environment_id }}
Original file line number Diff line number Diff line change @@ -24,13 +24,19 @@ jobs:
2424 - name : Set a ID based on the branch name
2525 id : set_environment_id
2626 run : |
27- JIRA_TICKET=$(echo '${{ github.event.pull_request.head.ref }}' | grep -Po --color=none '[A-z]{3,4}-[0-9]{3,5}' | tr '[:upper:]' '[:lower:]' || true)
28- BRANCH_HASH=$(echo '${{ github.event.pull_request.head.ref }}' | sha256sum | head -c 6)
27+ JIRA_TICKET=$(
28+ echo '${{ github.event.pull_request.head.ref }}' | \
29+ grep -Po --color=none '[A-z]{3,4}-[0-9]{3,5}' | \
30+ sed 's/-//g' | \
31+ tr '[:upper:]' '[:lower:]' || \
32+ true
33+ )
34+ BRANCH_HASH=$(echo '${{ github.event.pull_request.head.ref }}${{ github.event.pull_request.id }}' | sha256sum | head -c 6)
2935
3036 if [ -z "$JIRA_TICKET" ]; then
31- echo "environment_id=pr- ${BRANCH_HASH}" > $GITHUB_OUTPUT
37+ echo "environment_id=${BRANCH_HASH}" > $GITHUB_OUTPUT
3238 else
33- echo "environment_id=pr- ${JIRA_TICKET}-${BRANCH_HASH}" > $GITHUB_OUTPUT
39+ echo "environment_id=${JIRA_TICKET}-${BRANCH_HASH}" > $GITHUB_OUTPUT
3440 fi
3541
3642 outputs :
You can’t perform that action at this time.
0 commit comments