Fix to run check-docs-changes worflow in forks #1710
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
git-auto-commit-action
does support updating fork PRs as specified here - stefanzweifel/git-auto-commit-action#211.This fix has been taken from going through above issue and reading following links:
@Lancetnik GitHub notifies that using
pull_request_target
could be potentially unsafe and could expose secrets - https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/. But GitHub also mentions that it is fine to usepull_request_target
to update PR with stuff like adding label, adding comment, etc.I believe for our use case, which is updating docs in PR, we could use
pull_request_target
incheck-docs-changes
CI job. Please keep in mind that we shouldn't usepull_request_target
anywhere else.I have observed that
FastAPI
also usespull_request_target
in its workflows for automation cases like our case.Finally, this solution works for fork PRs. I have created a PR in which I have added a dummy file with a dummy class - #1709. I created my PR to this current branch(
fix-update-api-docs-action
) instead ofmain
branch.check-docs-changes
ran successfuly https://github.com/airtai/faststream/actions/runs/10487467300/job/29047872884 and added docs changes as new commit - https://github.com/airtai/faststream/pull/1709/commitsFixes #1705
Type of change
Please delete options that are not relevant.
Checklist
scripts/lint.sh
shows no errors)scripts/test-cov.sh
scripts/static-analysis.sh