-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Is your feature request related to a problem? Please describe.
Currently in the main branch as of 19b0cb3 every time a PR is opened the acceptance tests defined in https://github.com/MobilityData/gtfs-validator/blob/master/docs/ACCEPTANCE_TESTS.md run on the pull request, and at the end of execution the reports from the tests are uploaded to Google Cloud.
However, as discussed in #1094, when PRs are opened from forks this upload fails because the Google Cloud credentials aren't configured for the fork.
As a result, the acceptance tests are currently broken for all PRs opened from forks because they fail when the report upload to Google Cloud fails.
Proposed solution
In PR #1102, the upload of the reports to Google Cloud are effectively disabled for all PRs (including ones from forks and those from branches on this repo). The reports are still available via access to GitHub Action storage, although I believe they are time-limited to 90 days and then disappear (while the Google Cloud reports live forever).
Ideally, the reports should be uploaded when a PR is opened from a branch on this repo and only skipped when the PR is opened from a fork.
As can be seen here:
https://github.com/MobilityData/gtfs-validator/runs/6217818957?check_suite_focus=true
...they are skipped because the IF statement in the script that checks for Google Cloud credentials always returns false. Here's the exact message that always happens (even on PRs from branches on this repo):
Run if [ "***" != "" ]; then
if [ "***" != "" ]; then
echo "Secrets to upload validations reports to Google Cloud are configured in the repo."
echo "::set-output name=ok::true"
else
echo "Secrets are NOT configured to upload validation reports to Google Cloud - skipping upload. This is expected for pull requests from forks."
echo "::set-output name=ok::false"
fi
shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/[2](https://github.com/MobilityData/gtfs-validator/runs/6217818957?check_suite_focus=true#step:2:2)e92074e-086d-468a-bded-a0c7a8[3](https://github.com/MobilityData/gtfs-validator/runs/6217818957?check_suite_focus=true#step:2:3)a1daf.sh: line 1: [: too many arguments
Secrets are NOT configured to upload validation reports to Google Cloud - skipping upload. This is expected for pull requests from forks.The exact IF statement that isn't working correctly in the script is:
if [ "${{ secrets.VALIDATOR_SA_KEY }}" != "" ]; then
echo "Secrets to upload validations reports to Google Cloud are configured in the repo."
echo "::set-output name=ok::true"
else
echo "Secrets are NOT configured to upload validation reports to Google Cloud - skipping upload. This is expected for pull requests from forks."
echo "::set-output name=ok::false"
fiThis issue is open to indicate that we should troubleshoot this at some point to get the uploaded reports working again for PRs from branches on this repo (but not for forks).
Describe alternatives you've considered
Don't upload the reports to Google Cloud at all - effectively just remove the section of the GitHub Action that performs the upload.