File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 40
40
- name : Pull container image
41
41
run : docker pull "${{env.CONTAINER_IMAGE}}"
42
42
43
-
43
+ - name : Escape pull request title
44
+ run : |
45
+ import json
46
+ import os
47
+ import shlex
48
+ with open('${{ github.event_path }}') as fh:
49
+ event = json.load(fh)
50
+ escaped = event['pull_request']['title']
51
+ with open(os.environ['GITHUB_ENV'], 'a') as fh:
52
+ print(f'PR_TITLE={escaped}', file=fh)
53
+ shell : python3 {0}
54
+
44
55
- name : Run container
45
56
run : |
46
57
docker run -d --name "${{env.CONTAINER_NAME}}" $CONTAINER_IMAGE sleep infinity
85
96
if : steps.check_changes.outcome != 'failure'
86
97
run : |
87
98
echo "--Running jenkins_api.py with input sha - $input_sha for pull request - $input_pr_url"
88
- docker exec -e JENKINS_URL=${{secrets.CI_JENKINS_URL}} -e GITHUB_PAT=${{secrets.CI_GITHUB_TOKEN}} "${{env.CONTAINER_NAME}}" /bin/bash -c "python3 jenkins_api.py -s \"${JENKINS_URL}\" -jn \"${pipeline_name}\" -ghr \"${GITHUB_REPOSITORY}\" -ghsha \"${input_sha}\" -ghprn \"${input_pr_num}\" -ghpru \"${input_pr_url}\" -ghprt '${input_pr_title }' -ghpat=\"${svc_acc_org_secret}\""
99
+ docker exec -e JENKINS_URL=${{secrets.CI_JENKINS_URL}} -e GITHUB_PAT=${{secrets.CI_GITHUB_TOKEN}} "${{env.CONTAINER_NAME}}" /bin/bash -c "python3 jenkins_api.py -s \"${JENKINS_URL}\" -jn \"${pipeline_name}\" -ghr \"${GITHUB_REPOSITORY}\" -ghsha \"${input_sha}\" -ghprn \"${input_pr_num}\" -ghpru \"${input_pr_url}\" -ghprt '${PR_TITLE }' -ghpat=\"${svc_acc_org_secret}\""
89
100
90
101
- name : Stop and remove container
91
102
if : always()
You can’t perform that action at this time.
0 commit comments