Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] add a workflow to fix a PR #2

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
43 changes: 43 additions & 0 deletions .github/workflows/fix-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Fix My PR"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

permissions:
actions: write
contents: read

jobs:
FixMyPR:
if: github.event.comment.body == 'please fix my PR'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: ~1.20.10
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: changelog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: "Fix PR"
run: |
.github/workflows/scripts/check-collector-module-versions.sh
make generate gogci goporto gotidy crosslink genotelcontribcol gendependabot generate-gh-issue-templates
Copy link
Collaborator

Choose a reason for hiding this comment

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

If these are requirements for valid PRs I think a pre-commit hook running on the devs' devices would be an immediate way to enforce that without introducing greater chances of ci flake/churn/vulnerabilities.

git config user.name github-actions
git config user.email [email protected]
git add .
git commit -a -m "Fix PR"
git push


4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ stability-tests: otelcontribcol
@echo Stability tests are disabled until we have a stable performance environment.
@echo To enable the tests replace this echo by $(MAKE) -C testbed run-stability-tests

.PHONY: gogci
gogci:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="gci"

.PHONY: gotidy
gotidy:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="tidy"
Expand Down
6 changes: 6 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ CROSSLINK := $(TOOLS_BIN_DIR)/crosslink
GOJUNIT := $(TOOLS_BIN_DIR)/go-junit-report
BUILDER := $(TOOLS_BIN_DIR)/builder
GOVULNCHECK := $(TOOLS_BIN_DIR)/govulncheck
GCI := $(TOOLS_BIN_DIR)/gci

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down Expand Up @@ -202,3 +203,8 @@ moddownload:
updatedep:
$(PWD)/internal/buildscripts/update-dep
@$(MAKE) tidy

.PHONY: gci
gci: $(TOOLS_BIN_DIR)/gci
@echo "running $(GCI)"
@$(GCI) write -s standard -s default -s "prefix(github.com/open-telemetry/opentelemetry-collector-contrib)" $(ALL_SRC_AND_DOC)
Loading