Conversation
This allows is to fetch the PR directly instead of obtaining it from the event. It is an alternative solution for when we are using a dispatch event. Resolves #93
rzadp
reviewed
Oct 17, 2023
| echo "Saving PR number: $PR_NUMBER" | ||
| mkdir -p ./pr | ||
| echo $PR_NUMBER > ./pr/pr_number | ||
| - uses: actions/upload-artifact@v3 |
Contributor
There was a problem hiding this comment.
What about conflicts? What if there are 2 PRs opened at the same time?
They won't interfere? Can we be sure?
Contributor
Author
There was a problem hiding this comment.
Yeah, it won't be a problem because the artifact name is extracted specifically from a job.
The code that does that in Bullrich/extract-text-from-artifact is
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == process.env.ARTIFACT_NAME
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});So it makes sure to extract the artifact of the given workflow by id and not by name.
rzadp
approved these changes
Oct 17, 2023
Bullrich
added a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Oct 17, 2023
Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change in the logic of the action to overcome some problems with permissions coming from PRs from forks For this, we needed to divide the actions into two files: - A first action that triggers on PRs and reviews and uploads the PR number. - A second action which is triggered under the completion of the first one and runs as the action normally runs (but won't have any problems regarding permissions because it is triggered from the master branch)
Bullrich
added a commit
to Bullrich/polkadot-fellows-runtimes
that referenced
this pull request
Oct 17, 2023
Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change in the logic of the action to overcome some problems with permissions coming from PRs from forks For this, we needed to divide the actions into two files: - A first action that triggers on PRs and reviews and uploads the PR number. - A second action which is triggered under the completion of the first one and runs as the action normally runs (but won't have any problems regarding permissions because it is triggered from the master branch)
bkchr
pushed a commit
to polkadot-fellows/runtimes
that referenced
this pull request
Oct 18, 2023
Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change in the logic of the action to overcome some problems with permissions coming from PRs from forks For this, we needed to divide the actions into two files: - A first action that triggers on PRs and reviews and uploads the PR number. - A second action which is triggered under the completion of the first one and runs as the action normally runs (but won't have any problems regarding permissions because it is triggered from the master branch)
Bullrich
added a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Oct 18, 2023
Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change in the logic of the action to overcome some problems with permissions coming from PRs from forks For this, we needed to divide the actions into two files: - A first action that triggers on PRs and reviews and uploads the PR number. - A second action which is triggered under the completion of the first one and runs as the action normally runs (but won't have any problems regarding permissions because it is triggered from the master branch)
tdimitrov
pushed a commit
to paritytech/polkadot-sdk
that referenced
this pull request
Oct 23, 2023
Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change in the logic of the action to overcome some problems with permissions coming from PRs from forks For this, we needed to divide the actions into two files: - A first action that triggers on PRs and reviews and uploads the PR number. - A second action which is triggered under the completion of the first one and runs as the action normally runs (but won't have any problems regarding permissions because it is triggered from the master branch)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This allows is to fetch the PR directly instead of obtaining it from the event. It is an alternative solution for when we are using a dispatch event.
This resolves #93
This also allows the use of
environmentbecause every event is being triggered from the default branch.I also updated dependencies.