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

add workflow to create dependabot pr #10841

Merged

Conversation

codeboten
Copy link
Contributor

@codeboten codeboten commented Jun 8, 2022

This pr adds a workflow to replace the manual work required to commit all the dependabot PRs. The workflow:

  • checks out the code
  • runs .github/workflows/scripts/dependabot-pr.sh which looks for all dependabot PRs and applies the dependency update
  • runs tidy/builds the collector
  • commits a change and creates a PR

The workflow is triggered manually and the PR will be opened by the github-actions bot

@codeboten codeboten requested a review from a team as a code owner June 8, 2022 18:26
@codeboten codeboten requested a review from djaglowski June 8, 2022 18:26
@codeboten codeboten added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jun 8, 2022
This pr adds a workflow to replace the manual work required to commit all the dependabot PRs. The workflow:
- checks out the code
- runs .github/workflows/scripts/dependabot-pr.sh which looks for all dependabot PRs and applies the dependency update
- runs tidy/builds the collector
- commits a change and creates a PR

The workflow is triggered manually and the GITHUB_ACTOR who triggered the workflow is the user used to create the PR.
@codeboten codeboten force-pushed the codeboten/add-dependabot-workflow branch from 4c45833 to c8df22d Compare June 8, 2022 18:33
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a script you've been running locally? Have you been able to test it as a github action?

#!/bin/bash -ex

git config user.name $GITHUB_ACTOR
git config user.email [email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this handle the situation where the workflow starter is using the "Keep my email addresses private" option? For example, my users.noreply.github.com email is [email protected]. Will GITHUB_ACTOR contain TylerHelmuth or 12352919+TylerHelmuth? Or does it not matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was mistaken, the GITHUB_ACTOR is the github actions bot

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the workflow you linked it looks like it is the person who triggered the workflow:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, sorry this is confusing. The GITHUB_ACTOR is the user that triggered the action, which is used to create the commit, but the PR is using the GITHUB_TOKEN which is the github action bot's token
Screen Shot 2022-06-09 at 8 57 03 AM
Screen Shot 2022-06-09 at 8 57 12 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either ways it doesn't look like the email matters to github

.github/workflows/scripts/dependabot-pr.sh Outdated Show resolved Hide resolved
.github/workflows/scripts/dependabot-pr.sh Outdated Show resolved Hide resolved
@codeboten
Copy link
Contributor Author

Is this a script you've been running locally? Have you been able to test it as a github action?

I've run it in my fork, you can see the resulting PR here: codeboten#2748

Here's the action being run: https://github.com/codeboten/opentelemetry-collector-contrib/runs/6802784258?check_suite_focus=true

Alex Boten and others added 2 commits June 9, 2022 08:33
@codeboten codeboten merged commit eac0998 into open-telemetry:main Jun 9, 2022
kentquirk pushed a commit to McSick/opentelemetry-collector-contrib that referenced this pull request Jun 14, 2022
* add workflow to create dependabot pr

This pr adds a workflow to replace the manual work required to commit all the dependabot PRs. The workflow:
- checks out the code
- runs .github/workflows/scripts/dependabot-pr.sh which looks for all dependabot PRs and applies the dependency update
- runs tidy/builds the collector
- commits a change and creates a PR

The workflow is triggered manually and the GITHUB_ACTOR who triggered the workflow is the user used to create the PR.

* Update .github/workflows/scripts/dependabot-pr.sh

Co-authored-by: Tyler Helmuth <[email protected]>

* fix typo

Co-authored-by: Tyler Helmuth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants