Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

run go mod tidy (and set Go 1.15) and gofmt -s in copy workflow #42

Merged
merged 3 commits into from
Apr 1, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions .github/workflows/copy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,33 @@ jobs:
repository: ${{ matrix.cfg.target }}
token: ${{ secrets.WEB3BOT_GITHUB_TOKEN }}
persist-credentials: true
- name: git config
run: |
git config user.name web3-bot
git config user.email "[email protected]"
- name: run go mod tidy
run: |
go mod edit -go 1.15
go mod tidy
if ! git diff --quiet; then
git add .
git commit -m "run go mod tidy"
marten-seemann marked this conversation as resolved.
Show resolved Hide resolved
echo "NEEDS_UPDATE=1" >> $GITHUB_ENV
fi
- name: gofmt
run: |
gofmt -s -w .
if ! git diff --quiet; then
git add .
git commit -m "run gofmt -s"
echo "NEEDS_UPDATE=1" >> $GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

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

I kinda wonder if you could later just ask git "are there any commits ahead of the upstream branch?" instead of using NEEDS_UPDATE. Unrelated to this change though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we're committing to master here, we could just check if HEAD != origin/master. Just need to figure out an elegant way to pull that out of git.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do that in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good :) all LGTM

fi
- name: Checkout template repository
uses: actions/checkout@v2
with:
path: ${{ env.TEMPLATE_REPO_DIR }}
- name: Create commits
- name: Add files
run: |
git config user.name web3-bot
git config user.email "[email protected]"
for f in $(jq -r ".[]" <<< '${{ toJson(github.event.client_payload.files) }}'); do
echo -e "\nProcessing $f."
# add DO NOT EDIT header
Expand Down