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

docs: Added a Quick Start Guide to README #828

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AdamVacha
Copy link

@AdamVacha AdamVacha commented Feb 13, 2024

While going through the documentation for setting up GitHub-action for Renovate I noticed there wasn't a very newbie friendly quick-start guide. I through one together in the README.md with some easy setup and navigation.

Quick Start

Step 1: Renovate Explained

Renovate is a nifty tool for automatically updating your projects dependencies so you don't have to manually! Lets go through how to setup a GitHub Action for Renovate.

Step 2: Generate Personal Access Token (PAT)

We must generate a PAT for Renovate in order for it to be able to interact with your GitHub.

  1. Go to your GitHub settings.
  2. Navigate to Developer settings (the very bottom) and then select Personal access tokens (Tokens (classic)).
  3. Click Generate new token.
  4. Choose the 'repo' category at the top.
  5. Click Generate token at the bottom (and save it for later).

Step 3: Add Your PAT as a Secret in Your Repo

Now we add the PAT you created as a secret in your GitHub repo.

  1. Go to your repository.
  2. Navigate to Settings (top right) -> Secrets -> Actions.
  3. Click New repository secret.
  4. Name your secret RENOVATE_TOKEN and paste your PAT in the value field.
  5. Click Add Secret.

Step 4: Create renovate.json

Renovate requires this .json file so lets setup a basic one.

  1. Create renovate.json in the base of your repo.
  2. Specify a base configuration:
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:base"]
}

Step 5: Set Up GitHub Action Workflow

Here we need to setup the yaml for your Github Action Workflow.

  1. Make a new directory in your repo titled .github/workflows.
  2. Inside your new directory create a file renovate.yml.
  3. Define the workflow
name: Renovate

on:
  schedule:
    - cron: '0 3 * * *' 

jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Renovate
        uses: renovatebot/github-action@v40.0.3
        with:
          token: ${{ secrets.RENOVATE_TOKEN }}

this sets up your workflow to run at 3am daily (editable) which is when Renovate will check your dependencies for updates.

Steps 4 and 5 involve some simple .json and .yaml config that I could have made mistakes on.
I apologize ahead of time if either the .json or .yaml for workflow is incorrect, I'm quite new myself :)

This is supposed to be a simple setup requiring a PAT set to "RENOVATE_TOKEN" that allows user to setup a 3am daily Renovate check.

Thanks!

@viceice viceice changed the title Added a Quick Start Guide to README docs: Added a Quick Start Guide to README Feb 14, 2024
4. Name your secret `RENOVATE_TOKEN` and paste your PAT in the value field.
5. Click `Add secret`.

### `Step 4: Create renovate.json`
Copy link
Member

Choose a reason for hiding this comment

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

nope, not required step. renovate will onboard all accessable repos by default.


1. Make a new directory in your repo titled `.github/workflows`.
2. Inside your new directory create a file `renovate.yml`.
3. Define the workflow
Copy link
Member

Choose a reason for hiding this comment

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

Disable autodiscover and set repo explicit or set autodiscover filter for security reasons!

Copy link

@jsoref jsoref left a comment

Choose a reason for hiding this comment

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

Note that I really wished this was in the repository -- it would have saved me a lot of time and aggravation as I worked on preparing to write renovatebot/renovate#27346

I tried to get renovate-bot to work myself and failed miserably.

I ended up borrowing from a working instance -- and then I had to figure out how to change things:

  1. update the version using vars
  2. experiment with the meaning of null -- see the confusing definition of dryRun and null
  3. fix the configuration to actually run in my fork -- I didn't get any output that hinted to me that this was a problem, which made me 😢.

## Quick Start

### `Step 1: Renovate Explained`
Renovate is a nifty tool for automatically updating your projects dependencies so you don't have to manually! Lets go through how to setup a GitHub Action for Renovate.
Copy link

Choose a reason for hiding this comment

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

Suggested change
Renovate is a nifty tool for automatically updating your projects dependencies so you don't have to manually! Lets go through how to setup a GitHub Action for Renovate.
Renovate is a nifty tool for automatically updating your projects dependencies so you don't have to manually! Let's go through how to set up a GitHub Action for Renovate.

We must generate a PAT for Renovate in order for it to be able to interact with your GitHub.

1. Go to your GitHub settings.
2. Navigate to Developer settings (the very bottom) and then select Personal access tokens (Tokens (classic)).
Copy link

Choose a reason for hiding this comment

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

You could link directly to

Generate new token (classic)
and
Generate new token, Fine-grained/repo-scoped

Note that both work.

Copy link
Member

Choose a reason for hiding this comment

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

this should link to https://docs.renovatebot.com/modules/platform/github/ there as some more about auth for github.

but you can also use the action to run agains other platforms 😉

"extends": ["config:base"]
}
```
### `Step 5: Set Up GitHub Action Workflow`
Copy link

Choose a reason for hiding this comment

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

Suggested change
### `Step 5: Set Up GitHub Action Workflow`
### `Step 5: Set Up GitHub Action Workflow`

@@ -36,6 +36,70 @@ GitHub Action to run Renovate self-hosted.
| <a href="https://renovatebot.com"><img alt="Renovate enabled" src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square"></a> | Dependencies | Renovate |
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/actions/workflow/status/renovatebot/github-action/build.yml?style=flat-square"></a> | Build | GitHub Actions |

## Quick Start

### `Step 1: Renovate Explained`
Copy link

Choose a reason for hiding this comment

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

I wouldn't call this a step.

### `Step 1: Renovate Explained`
Renovate is a nifty tool for automatically updating your projects dependencies so you don't have to manually! Lets go through how to setup a GitHub Action for Renovate.

### `Step 2: Generate Personal Access Token (PAT)`
Copy link

Choose a reason for hiding this comment

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

I'm not sure I'd number the steps. I think it's better to just have an outline that links to named steps

Generate Personal Access Token (PAT)

-- I also wouldn't use backticks around these things.


```

this sets up your workflow to run at 3am daily (editable) which is when Renovate will check your dependencies for updates.
Copy link

Choose a reason for hiding this comment

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

Suggested change
this sets up your workflow to run at 3am daily (editable) which is when Renovate will check your dependencies for updates.
This sets up your workflow to run at 3am daily (editable) which is when Renovate will check your dependencies for updates.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you so much for the suggestions guys! I will follow them all and update my PR when I'm back from vacation next week.

@@ -36,6 +36,70 @@ GitHub Action to run Renovate self-hosted.
| <a href="https://renovatebot.com"><img alt="Renovate enabled" src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square"></a> | Dependencies | Renovate |
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/actions/workflow/status/renovatebot/github-action/build.yml?style=flat-square"></a> | Build | GitHub Actions |

## Quick Start
Copy link

Choose a reason for hiding this comment

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

As noted, it might be worth adding the word GitHub here -- possibly with other words (Workflow, "using a"?)

Suggested change
## Quick Start
## Quick Start with a GitHub Workflow

@viceice viceice marked this pull request as draft June 5, 2024 08:44
@viceice
Copy link
Member

viceice commented Jun 5, 2024

Marked as draft due to inactivity.

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.

3 participants