@@ -334,36 +334,36 @@ jobs:
334
334
issues : write
335
335
runs-on : ubuntu-latest
336
336
steps :
337
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
338
+ with :
339
+ show-progress : false
340
+ sparse-checkout : ' firebase-dataconnect/ci/'
341
+
342
+ - uses : actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
343
+ with :
344
+ python-version : ${{ env.FDC_PYTHON_VERSION }}
345
+
346
+ - run : pip install -r firebase-dataconnect/ci/requirements.txt
347
+
337
348
- id : issue-id
338
349
name : Determine GitHub Issue For Commenting
339
350
env :
340
351
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
352
+ working-directory : firebase-dataconnect/ci
341
353
run : |
342
354
set -euo pipefail
343
355
set -xv
344
356
345
- # If this job was triggered by a pull request, then check to see if
346
- # the description of the PR specifies a GitHub Issue to which to post
347
- # a comment. The GitHub Issue number is specified by including a line
348
- # of the form "trksmnkncd_notification_issue=6863" in the description.
349
- # Specifying an issue number in this manner is primarily intended for
350
- # debugging/development purposes of the comment-posting logic itself.
351
- # For example, issue number 6863 was specifically created for testing.
352
- # (see https://github.com/firebase/firebase-android-sdk/issues/6863)
353
- pr_number=$(echo '${{ github.ref }}' | sed -En 's#^refs/pull/([0-9]+)/merge$#\1#p')
354
- if [[ -n $pr_number ]] ; then
355
- issue_from_pr_body=$(gh issue view "$pr_number" --json body --jq '.body' -R ${{ github.repository }} | sed -En 's#(\s|^)trksmnkncd_notification_issue=([0-9]+)(\s|$)#\2#p')
356
- fi
357
-
358
- if [[ -v issue_from_pr_body ]] && [[ -n $issue_from_pr_body ]] ; then
359
- issue="$issue_from_pr_body"
360
- elif [[ '${{ github.event_name }}' == 'schedule' ]] ; then
361
- # See https://github.com/firebase/firebase-android-sdk/issues/6857
362
- issue=6857
363
- else
364
- issue=
365
- fi
357
+ python \
358
+ calculate_github_issue_for_commenting.py \
359
+ --output-file=github_issue_number.txt \
360
+ --github-ref='${{ github.ref }}' \
361
+ --github-repository='${{ github.repository }}' \
362
+ --github-event-name='${{ github.event_name }}' \
363
+ --pr-body-github-issue-key=trksmnkncd_notification_issue \
364
+ --github-issue-for-scheduled-run=6857 # https://github.com/firebase/firebase-android-sdk/issues/6857
366
365
366
+ issue="$(cat github_issue_number.txt)"
367
367
echo "issue=$issue" >> "$GITHUB_OUTPUT"
368
368
369
369
- name : Post Comment on GitHub Issue
0 commit comments