Skip to content

Commit 5713afb

Browse files
committed
dataconnect_demo_app.yml: post notifications like dataconnect.yml does
1 parent 2ef2763 commit 5713afb

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/dataconnect_demo_app.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
javaVersion:
99
gradleInfoLog:
1010
type: boolean
11+
pythonVersion:
1112
pull_request:
1213
paths:
1314
- firebase-dataconnect/demo/**
@@ -21,6 +22,7 @@ env:
2122
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
2223
FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools
2324
FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase
25+
FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }}
2426

2527
defaults:
2628
run:
@@ -167,3 +169,69 @@ jobs:
167169
--no-daemon \
168170
${{ (inputs.gradleInfoLog && '--info') || '' }} \
169171
spotlessCheck
172+
173+
send-notifications:
174+
needs:
175+
- 'test'
176+
- 'spotlessCheck'
177+
if: always()
178+
permissions:
179+
issues: write
180+
runs-on: ubuntu-latest
181+
steps:
182+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
183+
with:
184+
show-progress: false
185+
sparse-checkout: 'firebase-dataconnect/ci/'
186+
187+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
188+
with:
189+
python-version: ${{ env.FDC_PYTHON_VERSION }}
190+
191+
- run: pip install -r requirements.txt
192+
working-directory: firebase-dataconnect/ci
193+
194+
- id: issue-id
195+
name: Determine GitHub Issue For Commenting
196+
working-directory: firebase-dataconnect/ci
197+
env:
198+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199+
run: |
200+
args=(
201+
python
202+
calculate_github_issue_for_commenting.py
203+
--output-file=github_issue_number.txt
204+
--github-repository='${{ github.repository }}'
205+
--github-ref='${{ github.ref }}'
206+
--github-event-name='${{ github.event_name }}'
207+
--pr-body-github-issue-key=trksmnkncd_notification_issue
208+
--github-issue-for-scheduled-run=6891 # https://github.com/firebase/firebase-android-sdk/issues/6891
209+
)
210+
echo "${args[*]}"
211+
"${args[@]}"
212+
213+
set -xv
214+
issue="$(cat github_issue_number.txt)"
215+
echo "issue=$issue" >> "$GITHUB_OUTPUT"
216+
217+
- name: Post Comment on GitHub Issue
218+
if: steps.issue-id.outputs.issue != ''
219+
working-directory: firebase-dataconnect/ci
220+
env:
221+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
222+
run: |
223+
args=(
224+
python
225+
post_comment_for_job_results.py
226+
--github-issue='${{ steps.issue-id.outputs.issue }}'
227+
--github-repository='${{ github.repository }}'
228+
--github-sha='${{ github.sha }}'
229+
--github-repository-html-url='${{ github.event.repository.html_url }}'
230+
--github-run-id='${{ github.run_id }}'
231+
--github-run-number='${{ github.run_number }}'
232+
--github-run-attempt='${{ github.run_attempt }}'
233+
'test:${{ needs.test.result }}'
234+
'spotlessCheck:${{ needs.spotlessCheck.result }}'
235+
)
236+
echo "${args[*]}"
237+
exec "${args[@]}"

0 commit comments

Comments
 (0)