Skip to content

030/gomod-go-version-updater-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gomod-go-version-updater-action

The rationale for this action is that Dependabot cannot update the go version that is defined in a go.mod file.

Usage

  1. To use this action, ensure that: Allow GitHub Actions to create and approve pull requests option has been enabled in the action settings. In order to find this, attach: /settings/actions to the project URL, i.e.: https://github.com/<owner>/<project-name>/settings/actions.
  2. Once the setting has been enabled, create a ~/.github/workflows/gomod-go-version-updater.yml file with the following content:
    ---
    name: gomod-go-version-updater-action
    "on":
      schedule:
        - cron: "42 6 * * *"
    permissions:
      contents: write
      pull-requests: write
    jobs:
      gomod-go-version-updater-action:
        runs-on: ubuntu-22.04
        steps:
          - uses: 030/[email protected]
  3. To ensure that an action is triggered for testing the Golang version update, add a pull_request_review trigger. This will cause a specific Workflow Action to run whenever someone submits a review for the pull request created by the gomod-go-version-updater-action:
    "on":
      # required by gomod-go-version-updater to trigger this action once pr has
      # been reviewed
      pull_request_review:
        types: [submitted]
  4. Optional: if private go modules have to be downloaded:
    - uses: 030/[email protected]
      with:
        github-token-for-downloading-private-go-modules: ${{ secrets.GITHUB_TOKEN }}
  5. Optional: set the log level to DEBUG, WARNING, ERROR or CRITICAL (default: INFO):
    - uses: 030/[email protected]
      with:
        gomod-go-version-updater-action-log-level: DEBUG
  6. Optional: add an extra label to the PR that will be created:
    - uses: 030/[email protected]
      with:
        extra-pr-label: something

Test

See the run steps that are defined in this GitHub Workflow.