Skip to content

Commit 7e3a925

Browse files
cynthiajoanCynthia Jiang
andauthored
Update workflow to reduce spam (#509)
* update set-output * revert lannonbr/repo-permission-check-action version * update Co-authored-by: Cynthia Jiang <cynthiajiang@google.com>
1 parent de6f798 commit 7e3a925

File tree

4 files changed

+84
-83
lines changed

4 files changed

+84
-83
lines changed

.github/workflows/build_starter.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,40 +88,41 @@ jobs:
8888
run: |
8989
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
9090
platform=$( python scripts/gha/print_matrix_configuration.py -c -w config -k platform -o "${{ github.event.inputs.platforms }}" )
91-
echo "::set-output name=platform::${platform}"
92-
echo "::set-output name=release_label::${{ github.event.inputs.release_version }}-${{ github.event.inputs.rc_index }}"
93-
echo "::set-output name=release_version::${{ github.event.inputs.release_version }}"
94-
echo "::set-output name=apis::${{ github.event.inputs.apis }}"
95-
echo "::set-output name=unity_version::${{ github.event.inputs.unity_version }}"
96-
echo "::set-output name=should_trigger_package::${{ github.event.inputs.should_trigger_package }}"
97-
echo "::set-output name=runIntegrationTests::${{ github.event.inputs.runIntegrationTests }}"
98-
echo "::set-output name=firebase_cpp_sdk_version::${{ github.event.inputs.firebase_cpp_sdk_version }}"
99-
echo "::set-output name=unity_branch::${{ github.event.inputs.unity_branch }}"
100-
echo "::set-output name=additional_cmake_flags::${{ github.event.inputs.unity_branch }}"
91+
echo "platform=${platform}" >> $GITHUB_OUTPUT
92+
echo "release_label=${{ github.event.inputs.release_version }}-${{ github.event.inputs.rc_index }}" >> $GITHUB_OUTPUT
93+
echo "release_version=${{ github.event.inputs.release_version }}" >> $GITHUB_OUTPUT
94+
echo "apis=${{ github.event.inputs.apis }}" >> $GITHUB_OUTPUT
95+
echo "unity_version=${{ github.event.inputs.unity_version }}" >> $GITHUB_OUTPUT
96+
echo "should_trigger_package=${{ github.event.inputs.should_trigger_package }}" >> $GITHUB_OUTPUT
97+
echo "runIntegrationTests=${{ github.event.inputs.runIntegrationTests }}" >> $GITHUB_OUTPUT
98+
echo "firebase_cpp_sdk_version=${{ github.event.inputs.firebase_cpp_sdk_version }}" >> $GITHUB_OUTPUT
99+
echo "unity_branch=${{ github.event.inputs.unity_branch }}" >> $GITHUB_OUTPUT
100+
echo "additional_cmake_flags=${{ github.event.inputs.unity_branch }}" >> $GITHUB_OUTPUT
101101
else
102-
echo "::set-output name=platform::'Android,iOS,Windows,macOS,Linux,Playmode'"
103-
echo "::set-output name=release_label::nightly-$(date "+%Y%m%d-%H%M%S")"
104-
echo "::set-output name=release_version::NoVersion"
105-
echo "::set-output name=apis::'analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage'"
106-
echo "::set-output name=unity_version::2020"
107-
echo "::set-output name=should_trigger_package::true"
108-
echo "::set-output name=firebase_cpp_sdk_version::"
109-
echo "::set-output name=unity_branch::"
110-
echo "::set-output name=additional_cmake_flags::"
102+
echo "platform='Android,iOS,Windows,macOS,Linux,Playmode'" >> $GITHUB_OUTPUT
103+
echo "release_label=nightly-$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_OUTPUT
104+
echo "release_version=NoVersion" >> $GITHUB_OUTPUT
105+
echo "apis='analytics,auth,crashlytics,database,dynamic_links,firestore,functions,installations,messaging,remote_config,storage'" >> $GITHUB_OUTPUT
106+
echo "unity_version=2020" >> $GITHUB_OUTPUT
107+
echo "should_trigger_package=true" >> $GITHUB_OUTPUT
108+
echo "firebase_cpp_sdk_version=" >> $GITHUB_OUTPUT
109+
echo "unity_branch=" >> $GITHUB_OUTPUT
110+
echo "additional_cmake_flags=" >> $GITHUB_OUTPUT
111+
111112
if [[ "${{ github.event_name }}" == "schedule" ]]; then
112-
echo "::set-output name=runIntegrationTests::nightly-packaging"
113+
echo "runIntegrationTests=nightly-packaging" >> $GITHUB_OUTPUT
113114
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
114115
if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "tests-requested: quick" ]]; then
115-
echo "::set-output name=runIntegrationTests::${{ github.event.pull_request.number }}:label-quick-packaging"
116+
echo "runIntegrationTests=${{ github.event.pull_request.number }}:label-quick-packaging" >> $GITHUB_OUTPUT
116117
elif [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "tests-requested: full" ]]; then
117-
echo "::set-output name=runIntegrationTests::${{ github.event.pull_request.number }}:label-full-packaging"
118+
echo "runIntegrationTests=${{ github.event.pull_request.number }}:label-full-packaging" >> $GITHUB_OUTPUT
118119
elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged == true}}" == "true" ]]; then
119-
echo "::set-output name=runIntegrationTests::${{ github.event.pull_request.number }}:pr-close-packaging"
120+
echo "runIntegrationTests=${{ github.event.pull_request.number }}:pr-close-packaging" >> $GITHUB_OUTPUT
120121
else
121-
echo "::set-output name=invalid_trigger::1"
122+
echo "invalid_trigger=1" >> $GITHUB_OUTPUT
122123
fi
123124
else
124-
echo "::set-output name=invalid_trigger::1"
125+
echo "invalid_trigger=1" >> $GITHUB_OUTPUT
125126
fi
126127
fi
127128
- name: Cancel workflow
@@ -168,9 +169,9 @@ jobs:
168169
run: |
169170
if [[ "${{ needs.check_and_prepare.outputs.release_version }}" == "'NoVersion'" ]]; then
170171
# Triggered by callable
171-
echo "::set-output name=branch::${{ needs.check_and_prepare.outputs.unity_branch }}"
172+
echo "branch=${{ needs.check_and_prepare.outputs.unity_branch }}" >> $GITHUB_OUTPUT
172173
else
173-
echo "::set-output name=branch::${{ needs.update_versions.outputs.new_branch }}"
174+
echo "branch=${{ needs.update_versions.outputs.new_branch }}" >> $GITHUB_OUTPUT
174175
fi
175176
176177
build_android:

.github/workflows/integration_tests.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -63,49 +63,49 @@ jobs:
6363
run: |
6464
if [[ "${{ github.event.inputs.test_pull_request }}" == *"label-quick-packaging" ]]; then
6565
# Triggered by build_starter SDK workflow.
66-
echo "::set-output name=trigger::label_trigger"
67-
echo "::set-output name=requested_tests::auto"
68-
echo "::set-output name=github_ref::${{github.sha}}"
69-
echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)"
66+
echo "trigger=label_trigger" >> $GITHUB_OUTPUT
67+
echo "requested_tests=auto" >> $GITHUB_OUTPUT
68+
echo "github_ref=${{github.sha}}" >> $GITHUB_OUTPUT
69+
echo "pr_number=$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" >> $GITHUB_OUTPUT
7070
elif [[ "${{ github.event.inputs.test_pull_request }}" == *"label-full-packaging" ]]; then
7171
# Triggered by build_starter SDK workflow.
72-
echo "::set-output name=trigger::label_trigger"
73-
echo "::set-output name=requested_tests::expanded"
74-
echo "::set-output name=github_ref::${{github.sha}}"
75-
echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)"
72+
echo "trigger=label_trigger" >> $GITHUB_OUTPUT
73+
echo "requested_tests=expanded" >> $GITHUB_OUTPUT
74+
echo "github_ref=${{github.sha}}" >> $GITHUB_OUTPUT
75+
echo "pr_number=$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" >> $GITHUB_OUTPUT
7676
elif [[ "${{ github.event.inputs.test_pull_request }}" == *"pr-close-packaging" ]]; then
7777
# Triggered by build_starter SDK workflow.
78-
echo "::set-output name=trigger::postsubmit_trigger"
79-
echo "::set-output name=requested_tests::auto"
80-
echo "::set-output name=github_ref::${{github.sha}}"
81-
echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)"
78+
echo "trigger=postsubmit_trigger" >> $GITHUB_OUTPUT
79+
echo "requested_tests=auto" >> $GITHUB_OUTPUT
80+
echo "github_ref=${{github.sha}}" >> $GITHUB_OUTPUT
81+
echo "pr_number=$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" >> $GITHUB_OUTPUT
8282
elif [[ "${{ github.event.inputs.test_pull_request }}" == "nightly-packaging" ]]; then
8383
# Triggered by build_starter SDK workflow.
84-
echo "::set-output name=trigger::scheduled_trigger"
85-
echo "::set-output name=requested_tests::expanded"
86-
echo "::set-output name=github_ref::${{github.sha}}"
84+
echo "trigger=scheduled_trigger" >> $GITHUB_OUTPUT
85+
echo "requested_tests=expanded" >> $GITHUB_OUTPUT
86+
echo "github_ref=${{github.sha}}" >> $GITHUB_OUTPUT
8787
elif [[ "${{ github.event.inputs.test_pull_request }}" == "1" ]]; then
8888
# Triggered by build_starter SDK workflow.
89-
echo "::set-output name=trigger::manual_trigger"
90-
echo "::set-output name=requested_tests::auto"
91-
echo "::set-output name=github_ref::${{github.sha}}"
89+
echo "trigger=manual_trigger" >> $GITHUB_OUTPUT
90+
echo "requested_tests=auto" >> $GITHUB_OUTPUT
91+
echo "github_ref=${{github.sha}}" >> $GITHUB_OUTPUT
9292
else
9393
# Triggered manually
94-
echo "::set-output name=trigger::manual_trigger"
94+
echo "trigger=manual_trigger" >> $GITHUB_OUTPUT
9595
if [[ "${{ github.event.inputs.use_expanded_matrix }}" == "1" ]]; then
96-
echo "::set-output name=requested_tests::expanded"
96+
echo "requested_tests=expanded" >> $GITHUB_OUTPUT
9797
fi
9898
if [[ -z "${{github.event.inputs.test_pull_request}}" ]]; then
9999
# test_pull_request not specified
100-
echo "::set-output name=github_ref::${{github.sha}}"
100+
echo "github_ref=${{github.sha}}" >> $GITHUB_OUTPUT
101101
elif [[ "${{github.event.inputs.test_pull_request}}" == *:* ]]; then
102102
# If specified as pr:commit_hash, split them.
103-
echo "::set-output name=github_ref::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f2)"
104-
echo "::set-output name=pr_number::$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)"
103+
echo "github_ref=$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f2)" >> $GITHUB_OUTPUT
104+
echo "pr_number=$(echo ${{ github.event.inputs.test_pull_request }} | cut -d: -f1)" >> $GITHUB_OUTPUT
105105
else
106106
# Just the PR specified, use refs/pull/<number>/merge as the ref.
107-
echo "::set-output name=github_ref::refs/pull/${{github.event.inputs.test_pull_request}}/merge"
108-
echo "::set-output name=pr_number::${{ github.event.inputs.test_pull_request }}"
107+
echo "github_ref=refs/pull/${{github.event.inputs.test_pull_request}}/merge" >> $GITHUB_OUTPUT
108+
echo "pr_number=${{ github.event.inputs.test_pull_request }}" >> $GITHUB_OUTPUT
109109
fi
110110
fi
111111
- uses: actions/checkout@v3
@@ -140,10 +140,10 @@ jobs:
140140
fi
141141
# To feed input into the job matrix, we first need to convert to a JSON
142142
# list. Then we can use fromJson to define the field in the matrix for the tests job.
143-
echo "::set-output name=apis::$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${TEST_MATRIX_PARAM} )"
144-
echo "::set-output name=build_matrix::$( python scripts/gha/print_matrix_configuration.py -build_matrix -unity_versions "${{github.event.inputs.unity_versions}}" -platforms "${{github.event.inputs.platforms}}" -os "${{github.event.inputs.build_os}}" -mobile_test_on "${{github.event.inputs.mobile_test_on}}" ${TEST_MATRIX_PARAM})"
145-
echo "::set-output name=test_matrix::$( python scripts/gha/print_matrix_configuration.py -test_matrix -unity_versions "${{github.event.inputs.unity_versions}}" -platforms "${{github.event.inputs.platforms}}" -os "${{github.event.inputs.build_os}}" -mobile_test_on "${{github.event.inputs.mobile_test_on}}" ${TEST_MATRIX_PARAM})"
146-
echo "::set-output name=playmode_matrix::$( python scripts/gha/print_matrix_configuration.py -playmode_matrix -unity_versions "${{github.event.inputs.unity_versions}}" -platforms "${{github.event.inputs.platforms}}" -os "${{github.event.inputs.build_os}}" ${TEST_MATRIX_PARAM})"
143+
echo "apis=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${TEST_MATRIX_PARAM} )" >> $GITHUB_OUTPUT
144+
echo "build_matrix=$( python scripts/gha/print_matrix_configuration.py -build_matrix -unity_versions "${{github.event.inputs.unity_versions}}" -platforms "${{github.event.inputs.platforms}}" -os "${{github.event.inputs.build_os}}" -mobile_test_on "${{github.event.inputs.mobile_test_on}}" ${TEST_MATRIX_PARAM})" >> $GITHUB_OUTPUT
145+
echo "test_matrix=$( python scripts/gha/print_matrix_configuration.py -test_matrix -unity_versions "${{github.event.inputs.unity_versions}}" -platforms "${{github.event.inputs.platforms}}" -os "${{github.event.inputs.build_os}}" -mobile_test_on "${{github.event.inputs.mobile_test_on}}" ${TEST_MATRIX_PARAM})" >> $GITHUB_OUTPUT
146+
echo "playmode_matrix=$( python scripts/gha/print_matrix_configuration.py -playmode_matrix -unity_versions "${{github.event.inputs.unity_versions}}" -platforms "${{github.event.inputs.platforms}}" -os "${{github.event.inputs.build_os}}" ${TEST_MATRIX_PARAM})" >> $GITHUB_OUTPUT
147147
- name: Update PR label and comment
148148
if: steps.set_outputs.outputs.pr_number
149149
run: |
@@ -168,8 +168,8 @@ jobs:
168168
steps:
169169
- id: matrix_info
170170
run: |
171-
echo "::set-output name=info::${{ matrix.unity_version }}-${{matrix.os}}-${{ matrix.platform }}-${{ matrix.ios_sdk }}"
172-
echo "::set-output name=artifact_suffix::${{ matrix.unity_version }}-${{matrix.os}}-${{ matrix.ios_sdk }}"
171+
echo "info=${{ matrix.unity_version }}-${{matrix.os}}-${{ matrix.platform }}-${{ matrix.ios_sdk }}" >> $GITHUB_OUTPUT
172+
echo "artifact_suffix=${{ matrix.unity_version }}-${{matrix.os}}-${{ matrix.ios_sdk }}" >> $GITHUB_OUTPUT
173173
- uses: actions/checkout@v3
174174
- name: Setup python
175175
uses: actions/setup-python@v4
@@ -344,7 +344,7 @@ jobs:
344344
steps:
345345
- id: matrix_info
346346
run: |
347-
echo "::set-output name=info::${{ matrix.unity_version }}-${{matrix.os}}-Playmode-github_runner-${{ matrix.os }}"
347+
echo "info=${{ matrix.unity_version }}-${{matrix.os}}-Playmode-github_runner-${{ matrix.os }}" >> $GITHUB_OUTPUT
348348
- uses: actions/checkout@v3
349349
- name: Setup python
350350
uses: actions/setup-python@v4
@@ -444,8 +444,8 @@ jobs:
444444
steps:
445445
- id: matrix_info
446446
run: |
447-
echo "::set-output name=info::${{ matrix.unity_version }}-${{matrix.build_os}}-${{ matrix.platform }}-${{ matrix.test_device }}-${{ matrix.test_os }}"
448-
echo "::set-output name=artifact_path::testapps-${{ matrix.platform }}-${{ matrix.unity_version }}-${{matrix.build_os}}-${{ matrix.ios_sdk }}"
447+
echo "info=${{ matrix.unity_version }}-${{matrix.build_os}}-${{ matrix.platform }}-${{ matrix.test_device }}-${{ matrix.test_os }}" >> $GITHUB_OUTPUT
448+
echo "artifact_path=testapps-${{ matrix.platform }}-${{ matrix.unity_version }}-${{matrix.build_os}}-${{ matrix.ios_sdk }}" >> $GITHUB_OUTPUT
449449
- uses: actions/checkout@v3
450450
with:
451451
ref: ${{needs.check_and_prepare.outputs.github_ref}}

.github/workflows/package.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ jobs:
6060
IFS=',' read -r -a input_apis <<< "${{ inputs.apis }}"
6161
IFS=',' read -r -a default_apis <<< "${{ env.default_apis }}"
6262
if [[ ${#input_apis[@]} != ${#default_apis[@]} ]]; then
63-
echo "::set-output name=package_for_checks::1"
64-
echo "::set-output name=package_apis::'--apis=${{ inputs.apis }}'"
63+
echo "package_for_checks=1" >> $GITHUB_OUTPUT
64+
echo "package_apis='--apis=${{ inputs.apis }}'" >> $GITHUB_OUTPUT
6565
else
66-
echo "::set-output name=package_for_checks::0"
67-
echo "::set-output name=package_apis::"
66+
echo "package_for_checks=0" >> $GITHUB_OUTPUT
67+
echo "package_apis=" >> $GITHUB_OUTPUT
6868
fi
6969
7070
- name: Print inputs
@@ -196,17 +196,17 @@ jobs:
196196
git commit -a -m "${commit_title}
197197
198198
${commit_body}"
199-
echo "::set-output name=branch_pushed::1"
199+
echo "branch_pushed=1" >> $GITHUB_OUTPUT
200200
# Show changes in git log
201201
git diff
202202
# Push branch
203203
git push --set-upstream origin "${NEW_BRANCH}"
204204
# Create pull request
205205
pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --head "${NEW_BRANCH}" --base "${{ github.event.inputs.baseBranch }}" --title "${commit_title}" --body "${commit_body}")
206-
echo "::set-output name=created_pr_number::${pr_number}"
206+
echo "created_pr_number=${pr_number}" >> $GITHUB_OUTPUT
207207
else
208208
echo "::warning ::No changes detected, won't create pull request."
209-
echo "::set-output name=branch_pushed::0"
209+
echo "branch_pushed=0" >> $GITHUB_OUTPUT
210210
fi
211211
212212
- name: Create Zip File

0 commit comments

Comments
 (0)