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 BOT_GITHUB_TOKEN validation to help-comment-issue workflow #106

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Jan 3, 2024

PR Feedback (click)

  • 👍 Sweep Did Well
  • 👎 Sweep Needs Improvement
    I created this PR to fix the failing GitHub Actions.## Description
    This PR adds a validation step to the help-comment-issue.yml workflow to check if the BOT_GITHUB_TOKEN secret is set and valid. This is done to prevent the workflow from failing due to bad credentials.

The validation is done by trying to fetch the repository's details using the octokit.rest.repos.get method with the BOT_GITHUB_TOKEN as the authentication token. If the fetch operation fails, the workflow fails with an error message indicating that the BOT_GITHUB_TOKEN secret is not set or invalid.

Summary of Changes

  • Added a new step at the beginning of the help-comment-issue.yml workflow to validate the BOT_GITHUB_TOKEN secret.
  • Used the actions/github-script@v3 action to run a script that checks the validity of the token.
  • Added error handling to fail the workflow with an appropriate error message if the token is not set or invalid.

@sweep-ai sweep-ai bot assigned cubxxw Jan 3, 2024
Copy link
Contributor Author

sweep-ai bot commented Jan 3, 2024

Rollback Files For Sweep

  • Rollback changes to .github/workflows/help-comment-issue.yml
  • Rollback changes to .github/workflows/help-comment-issue.yml

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Jan 3, 2024
Copy link
Contributor Author

sweep-ai bot commented Jan 3, 2024

Sandbox Executions

  • Running GitHub Actions for .github/workflows/help-comment-issue.yml
Check .github/workflows/help-comment-issue.yml with contents:

Ran GitHub Actions for 35c9081b8e8a7cc9adedcce3c3fe881719db73b4:

Copy link
Contributor Author

sweep-ai bot commented Jan 3, 2024

Sweeping

Fixing PR: track the progress here.

I'm currently fixing this PR to address the following:

[Sweep GHA Fix] The GitHub Actions run failed with the following error logs:

The command:
Run contributor-assistant/[email protected]
yielded the following error:
##[error]graphql call to get the committers details failed: HttpError: Bad credentials

Here are the logs:
CLA Assistant GitHub Action bot has started the process

Making changes according to plan... (step 3/3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant