Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

sue445/go-mod-tidy-pr

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[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: github-actions@example.cpm
          # 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