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

create a workflow for auto merge prs and a Dockerfile #16

Merged
merged 1 commit into from
Jan 11, 2024
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
30 changes: 30 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto Merge PRs
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test-and-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.18.1'

- name: Test
run: go test ./...

- name: Merge PR
if: github.event.pull_request.mergeable_state == 'clean'
uses: pascalgn/[email protected]
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "auto-merge,approved" # Specify your labels here
MERGE_METHOD: "squash" # Choose merge method: merge, squash or rebase
MERGE_RETRIES: "3"
MERGE_RETRY_SLEEP: "10000"
MERGE_REMOVE_LABELS: "auto-merge,approved"
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.20.3-alpine

# Set the working dir
WORKDIR /app

# Copy the go.mod and go.sum files to the working dir
COPY go.mod go.sum ./

# Download and install any requires Go dependencies
RUN go mod download

# Copy the entire source to the working dir
COPY . .

# Build the go application
RUN go build -o main .

# Expose the port specified by the PORT env variiable
EXPOSE 3000

# Set the entry point of the container to the executable
CMD ["./main"]
Loading