Skip to content

Commit 1d0f681

Browse files
committed
Ignore failed integration test workflow job for Dependabot PRs
The integration test workflow requires the GITHUB_TOKEN token to have write permissions in order to make the report comment. Because the token only has read permissions when the workflow is triggered by a PR from a fork, the job is configured to pass even though the action run step fails (it is intentionally run instead of being skipped because it can still provide some validation even if it is expected to fail). Currently the workflow is configured to require the step to pass when a PR is submitted from a local branch, since the token has write permissions in that case. However, there is one exception: when the PR is submitted by Dependabot, the token permissions are downgraded. So the workflow must be configured to treat the PRs from Dependabot in the same manner as PRs from forks
1 parent 133a7df commit 1d0f681

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/test-integration.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ jobs:
3333
- name: Run action
3434
# Use arduino/report-size-deltas action from local path
3535
uses: ./
36-
# The action will always fail on PRs submitted from forks due to not having write permissions.
36+
# The action will always fail on PRs submitted from forks or by Dependabot due to not having write permissions.
3737
# Some verification can still be achieved by checking the log to see whether it failed in the expected manner:
3838
# WARNING:__main__:Temporarily unable to open URL (HTTP Error 403: Forbidden), retrying
3939
# ...
4040
# TimeoutError: Maximum number of URL load retries exceeded
41-
continue-on-error: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
41+
continue-on-error: >-
42+
${{
43+
github.event.pull_request.head.repo.full_name != github.repository ||
44+
github.triggering_actor == 'dependabot[bot]'
45+
}}
4246
with:
4347
sketches-reports-source: .github/workflows/testdata/sketches-reports
4448

@@ -50,5 +54,12 @@ jobs:
5054
uses: actions/checkout@v3
5155

5256
- name: Run action
57+
# The action will always fail on pushes by Dependabot due to not having write permissions.
58+
# Rather than skipping the job under these conditions, the failure is ignored because some verification can
59+
# still be achieved by checking the log to see whether it failed in the expected manner:
60+
# WARNING:__main__:Temporarily unable to open URL (HTTP Error 403: Forbidden), retrying
61+
# ...
62+
# TimeoutError: Maximum number of URL load retries exceeded
63+
continue-on-error: ${{ github.triggering_actor == 'dependabot[bot]' }}
5364
# Use arduino/report-size-deltas action from local path
5465
uses: ./

0 commit comments

Comments
 (0)