Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label previous PRs #304

Closed
PythonCoderAS opened this issue Jan 5, 2022 · 5 comments · Fixed by #349
Closed

Label previous PRs #304

PythonCoderAS opened this issue Jan 5, 2022 · 5 comments · Fixed by #349
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@PythonCoderAS
Copy link

Is it possible to setup the workflow in such a way that it can also label old PRs with the same logic?

@rodik
Copy link

rodik commented Feb 5, 2022

I don't believe this is possible at the moment. This would require passing the PR_Number as Action input param.
It is currently resolved here:

labeler/src/labeler.ts

Lines 65 to 72 in 3194b4b

function getPrNumber(): number | undefined {
const pullRequest = github.context.payload.pull_request;
if (!pullRequest) {
return undefined;
}
return pullRequest.number;
}

Passing PR_Number as input would be a huge improvement for this action.

@vmarkovtsev
Copy link

You are welcome to try retrolabeler.

@MaksimZhukov MaksimZhukov added the feature request New feature or request to improve the current logic label Dec 12, 2022
@AndreiLobanovich
Copy link
Contributor

Hello @PythonCoderAS,
I appreciate your patience with this issue. I'd like to suggest a potential workaround that we believe could be an effective solution.
Once you've added the workflow to your main branch, you can then pull these changes into the branch you wish to label with the labeler. This action will in turn trigger the pull_request_target event, and as a result, the action will label the pull request as expected.
I hope this proves to be helpful.
Best regards!

@AndreiLobanovich AndreiLobanovich self-assigned this Jun 14, 2023
@PythonCoderAS
Copy link
Author

@AndreiLobanovich my issue is not labeling one PR, it's labeling everything before.

Let's say I have PRs 1-50, and on PR #51 I add the labeler workflow. How would I label PRs 1-50 now?

@AndreiLobanovich
Copy link
Contributor

AndreiLobanovich commented Jun 22, 2023

@PythonCoderAS, sure. We are working on the solution in this PR. Should be done soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@vmarkovtsev @rodik @PythonCoderAS @AndreiLobanovich @MaksimZhukov and others