forked from freedomofpress/securedrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workaround for CircleCI's problems filtering from forks
CircleCI's branch filtering does not work properly with pull requests from forks. The CIRCLE_BRANCH variable contains something like freedomofpress/pull/3 in this case. This means that docs and i18n PRs from forks are not being tested as we wish; the translation tests are not run for i18n PRs, and the app tests are being run for docs PRs. A CircleCI feature request [1] to improve this was closed without explanation, so I'm incorporating a workaround suggested in the CircleCI forums: using the GitHub API to obtain the real branch name for PRs from forks, and skipping tests if it doesn't match. Not all steps of the relevant jobs are skipped, but the most expensive ones are. Also, stop skipping static-analysis-and-no-known-cves, as it doesn't take that long, and might prevent problems from sneaking in on branches with inaccurate names. [1] https://discuss.circleci.com/t/only-build-pull-requests-targetting-specific-branch/6082/6
- Loading branch information
Showing
1 changed file
with
52 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters