-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (32 loc) · 1.02 KB
/
dependabot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Dependabot mod fix
on:
push:
branches:
# Only run on dependabot Go branches
- 'dependabot/go_modules/**'
jobs:
fix:
runs-on: ubuntu-latest
container: 'golang:1.14'
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Fix detached HEAD
run: git checkout ${GITHUB_REF#refs/heads/} # https://github.com/actions/checkout/issues/6
- name: Tidy
run: |
go mod tidy
- name: Set up Git
env:
GITHUB_TOKEN: ${{ secrets.DEPENDABOT_FIX_GITHUB_TOKEN }}
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: Commit and push changes
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit --amend --no-edit
git push --force-with-lease
fi