Skip to content

Commit

Permalink
fix(CI): covert array to string error when use github-scripts
Browse files Browse the repository at this point in the history
covert array to string use join() insteadof str()

log:
  • Loading branch information
hudeng-go committed Aug 17, 2023
1 parent 39b9eda commit a1cecd7
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 44 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/01-parsec-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
shell: python
env:
GITHUB_TOKEN: ${{ github.token }}
PR_TITLE: ${{ github.event.issue.title }}
PR_AUTHOR: ${{ github.event.issue.user.login }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
import requests
import yaml
Expand Down Expand Up @@ -185,10 +185,10 @@ jobs:
data = read_integration()
message = data.get("message", "Integrated for V23-Beta2")
if message == "Integrated for V23-Beta2":
message = os.environ.get("PR_TITLE")
#if message == "Integrated for V23-Beta2":
# message = os.environ.get("PR_TITLE")
message = message + " by " + os.environ.get("PR_AUTHOR")
#message = message + " by " + os.environ.get("PR_AUTHOR")
set_output("integration_message", message)
with open("integration-${{ github.event.number }}-detail.md", "w+") as integration_detail:
integration_detail.write(message)
Expand Down Expand Up @@ -218,13 +218,19 @@ jobs:
if tagsha == "" and len(tagsha) <= 0 and tag == "" and len(tag) <= 0:
illegalTags.append({"repo": fullreponame, "tag": tag, "tagsha": tagsha})
allBuildTasks[order].get("data").get("payload").append(repo)
integrationinfo = str(integrationInfos)
integrationinfo = str("\n".join(integrationInfos))
print("integrationinfo: " + integrationinfo)
changelog = str(changelogs)
influence = str(influences)
changelog = str("\n".join(changelogs))
influence = str("\n".join(influences))
set_output("integrationinfo", integrationinfo)
with open("integration-${{ github.event.number }}-integrationinfo.md", "w+") as f:
f.write(integrationinfo)
set_output("changelog", changelog)
with open("integration-${{ github.event.number }}-changelog.md", "w+") as f:
f.write(changelog)
set_output("influence", influence)
with open("integration-${{ github.event.number }}-influence.md", "w+") as f:
f.write(influence)
set_output("milestone", "V23-Beta2")
if data.get('milestone', "") != "":
set_output("milestone", data.get('milestone'))
Expand Down Expand Up @@ -393,7 +399,11 @@ jobs:
core.setOutput('component', component)
- name: upload integration detail
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: integration-${{ github.event.number }}-detail.md
path: integration-${{ github.event.number }}-detail.md
name: integration-archive-${{ github.event.number }}
path: |
integration-${{ github.event.number }}-detail.md
integration-${{ github.event.number }}-integrationinfo.md
integration-${{ github.event.number }}-changelog.md
integration-${{ github.event.number }}-influence.md
4 changes: 2 additions & 2 deletions .github/workflows/02-integration-output.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
steps:

- name: download integration detail
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: integration-${{ github.event.number }}-detail.md
name: integration-archive-${{ github.event.number }}

- name: create comment
uses: actions/github-script@v6
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/auto-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ env:

jobs:
parsec_integration:
uses: deepin-community/Repository-Integration/.github/workflows/01-parsec-integration.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/01-parsec-integration.yml@master

ouput_message:
name: output integration
needs: parsec_integration
if: ${{ github.event.pull_request.head.sha }}
uses: deepin-community/Repository-Integration/.github/workflows/02-integration-output.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-integration-output.yml@master

build_project_prepare:
name: build project prepare
Expand All @@ -37,7 +37,7 @@ jobs:
set -x
result=$(curl -u golf66:$OSCPASS "https://build.deepin.com/source/deepin:CI:TestingIntegration:$TOPIC/_meta"|grep "unknown_project")
if [ "$result" != "" ];then
curl -o meta.xml https://raw.githubusercontent.com/deepin-community/Repository-Integration/master/.github/workflows/obs-proj-meta.tpl
curl -o meta.xml https://raw.githubusercontent.com/peeweep-test/Repository-Integration/master/.github/workflows/obs-proj-meta.tpl
sed -i "s#TOPIC#${TOPIC}#g" meta.xml
curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:$TOPIC/_meta"
fi
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
(needs.build-order-7.result == 'success' || needs.build-order-7.result == 'skipped') &&
(needs.build-order-8.result == 'success' || needs.build-order-8.result == 'skipped') &&
(needs.build-order-9.result == 'success' || needs.build-order-9.result == 'skipped')
uses: deepin-community/Repository-Integration/.github/workflows/issue-project-manager.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/issue-project-manager.yml@master
secrets: inherit
with:
repo: linuxdeepin/developer-center
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- build-order-8
- build-order-9
- create_issue_link_project
uses: deepin-community/Repository-Integration/.github/workflows/04-auto-test.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/04-auto-test.yml@master
if: |
always() && !cancelled() &&
(needs.parsec_integration.result == 'success') && (needs.ouput_message.result != 'failure' ) &&
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
- build-order-8
- build-order-9
- auto-test
uses: deepin-community/Repository-Integration/.github/workflows/05-merge-into-testing.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/05-merge-into-testing.yml@master
secrets: inherit
if: |
always() && !cancelled() &&
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
- deploy-repo
- parsec_integration
if: always() && !cancelled() && (needs.deploy-repo.result == 'success')
uses: deepin-community/Repository-Integration/.github/workflows/06-deployed.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/06-deployed.yml@master
secrets: inherit
with:
integrations: ${{ needs.parsec_integration.outputs.all_build_task }}
Expand All @@ -222,7 +222,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_0) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -238,7 +238,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_1) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -254,7 +254,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_2) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -270,7 +270,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_3) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -286,7 +286,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_4) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -303,7 +303,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_5) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -319,7 +319,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_6) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -335,7 +335,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_7) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -351,7 +351,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_8) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand All @@ -367,7 +367,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_9) }}
uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master
uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master
secrets: inherit
with:
repo: ${{ matrix.payload.repo }}
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/issue-project-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ jobs:
});
core.setOutput('app_token', token)
- name: Download integration files
uses: actions/download-artifact@v3
with:
name: integration-archive-${{ github.event.number }}

- name: Handle issue
id: issue
uses: actions/github-script@v6
uses: actions/github-script@v6.4.1
with:
github-token: ${{ steps.deepin-bot.outputs.app_token }}
script: |
Expand All @@ -131,23 +136,18 @@ jobs:
assignees = "${{ inputs.assignees }}".split(", ")
milestonestr = "${{ inputs.milestone }}"
status = "${{ inputs.status }}"
testrepoaddr = "${{ inputs.testrepoaddr }}"
integrationinfo = ""
if (Array.isArray(${{ inputs.integrationinfo }})) {
integrationinfo = ${{ inputs.integrationinfo }}.join("\n")
}
let integrationinfodata = fs.readFileSync('integration-${{ github.event.number }}-integrationinfo.md');
let integrationinfo = integrationinfodata.toString();
console.log("integrationinfo: ", integrationinfo)
testrepoaddr = "${{ inputs.testrepoaddr }}"
changelog = ""
if (Array.isArray(${{ inputs.changelog }})) {
changelog = ${{ inputs.changelog }}.join("\n")
}
let changelogdata = fs.readFileSync('integration-${{ github.event.number }}-changelog.md');
let changelog = changelog.toString();
console.log("changelog: ", changelog)
suggestion = "${{ inputs.suggestion }}"
influence = ""
if (Array.isArray(${{ inputs.influence }})) {
influence = ${{ inputs.influence }}.join("\n")
}
let influencedata = fs.readFileSync('integration-${{ github.event.number }}-influence.md');
let influence = influencedata.toString();
console.log("influence: ", influence)
extrainfo = "${{ inputs.extrainfo }}"
Expand Down

0 comments on commit a1cecd7

Please sign in to comment.