Skip to content

go-mod-tidy-pr

Actions
Run go mod tidy and create PullRequest on GitHub Actions
v1.5.2
Latest
Star (9)

[DEPRECATED] go-mod-tidy-pr

Run go mod tidy and create PullRequest on GitHub Actions

https://github.com/marketplace/actions/go-mod-tidy-pr

This is inspired by circleci-bundle-update-pr

Build Status

⚠️ DEPRECATION

Now, Dependabot officially supports go mod tidy.

https://github.blog/changelog/2020-10-19-dependabot-go-mod-tidy-and-vendor-support/

So this action is deprecated.

Example

example

#12

Usage

# .github/workflows/go-mod-tidy-pr.yml
name: go-mod-tidy-pr

on:
  schedule:
    - cron: "0 0 * * 1" # Weekly build
  workflow_dispatch:

jobs:
  go-mod-tidy-pr:
    name: go-mod-tidy-pr

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Run go-mod-tidy-pr
        uses: sue445/go-mod-tidy-pr@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          git_user_name: GitHub Actions
          git_user_email: [email protected]
          # reviewer: foo
          # assign: foo
          # milestone: some_milestone
          # labels: go-mod-tidy
          # draft: "true"
          # go_mod_directory: "/dir/to/go-mod"
          # go_version: 1.14.2
          # debug: "true"
          # duplicate: "true"
          # timezone: Asia/Tokyo

Parameters

Note ⚠️

If you configure Pull Request build on GitHub Action, builds doesn't trigger when go-mod-tidy-pr creates Pull Request.

https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token

The workaround is one of the following.

  1. Use GitHub App Token instead of secrets.GITHUB_TOKEN (RECOMMENDED)
    • Required permission: Pull requests (Read & write)
  2. Use personal access token instead of secrets.GITHUB_TOKEN
  3. Use CI other than GitHub Action on Pull Request build

CHANGELOG

https://github.com/sue445/go-mod-tidy-pr/blob/master/CHANGELOG.md

go-mod-tidy-pr is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Run go mod tidy and create PullRequest on GitHub Actions
v1.5.2
Latest

go-mod-tidy-pr is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.