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

Fix: Use PAT so that next workflows can be triggered. #144

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

ankit16-19
Copy link
Collaborator

@ankit16-19 ankit16-19 commented Apr 23, 2024

Description

WHY

So there were two issues with the older update

  1. I used ubuntu 18, Github CI stopped supporting that. i.e updatating to using latest.
  2. When a action is triggered by using GITHUB_TOKEN. it wouldn't trigger subsequent workflows.
    https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
    The workaround suggested is to use a PAT. Earlier there were security concerns but now. it's safer as we have fine-grained personal access token.

How to use

image

@bee-bot merge preview

Who can run

Only USERS or Collaborators would be able to run https://github.com/nwtgck/actions-merge-preview/blob/develop/src/main.ts#L25

How to setup PAT (with minimal access):

  1. https://github.com/settings/tokens
    image

  2. select repo
    image

  3. add these permission to token
    image

  4. Add token to your repository settings.

Tested & Working: ankit16-19#15

Checklist

  • Documentation Updated
  • sbt scalafmtAll Run (and optionally sbt scalafmtSbt)
  • At least one approval from a codeowner

Summary by CodeRabbit

  • Chores
    • Updated the system's underlying infrastructure to enhance performance and security.

Copy link

coderabbitai bot commented Apr 23, 2024

Walkthrough

The modifications to the workflow configuration involve an update to the operating system version by switching to ubuntu-latest from ubuntu-18.04. This ensures the latest security and performance enhancements are utilized. Additionally, the authentication method has been updated by replacing the github-token with PAT_TOKEN to potentially enhance security or accommodate new GitHub policies.

Changes

File Path Change Summary
.github/.../merge-preview.yml Updated OS to ubuntu-latest and replaced github-token with PAT_TOKEN

🐰✨
Oh hooray! Oh hooray!
In the land of code, big updates today!
From old Ubuntu, we hop away,
With PAT_TOKEN in hand, we're here to stay!
Let's celebrate, munch on some hay! 🌾


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Out of diff range and nitpick comments (1)
.github/workflows/merge-preview.yml (1)

15-15: Use of PAT_TOKEN enables enhanced capabilities; ensure it is securely handled.

.github/workflows/merge-preview.yml Show resolved Hide resolved
@ankit16-19 ankit16-19 mentioned this pull request Apr 23, 2024
3 tasks
@ankit16-19 ankit16-19 requested a review from nylonee April 24, 2024 05:33
@nylonee nylonee merged commit e315d04 into nylonee:main Apr 24, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants