v0.7
This commit is contained in:
parent
328a6c3ba2
commit
c088a98a3b
7 changed files with 42 additions and 63 deletions
4
.github/workflows/example.yml
vendored
4
.github/workflows/example.yml
vendored
|
|
@ -11,13 +11,13 @@ jobs:
|
||||||
- run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
- run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||||
id: slug
|
id: slug
|
||||||
- name: Chat Setup
|
- name: Chat Setup
|
||||||
uses: DTherHtun/google-chat-action@v0.6
|
uses: DTherHtun/google-chat-action@v0.7
|
||||||
with:
|
with:
|
||||||
project: ${{ github.repository }}
|
project: ${{ github.repository }}
|
||||||
commit: ${{ steps.slug.outputs.sha8 }}
|
commit: ${{ steps.slug.outputs.sha8 }}
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
status: ${{ job.status }}
|
status: ${{ job.status }}
|
||||||
actionid: ${{ github.repository_owner }}/${{ github.repository }}/runs/${{ github.run_id }}
|
actionid: ${{ github.repository }}/runs/${{ github.run_id }}
|
||||||
webhook: "https://chat.googleapis.com/v1/spaces/AAAAzPcAy4s/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=MmdzluicdrdkyUAV_QwB6BzlLcIhbfrwNzxVrEllaec%3D&threadKey=git-commit"
|
webhook: "https://chat.googleapis.com/v1/spaces/AAAAzPcAy4s/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=MmdzluicdrdkyUAV_QwB6BzlLcIhbfrwNzxVrEllaec%3D&threadKey=git-commit"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
28
Dockerfile
28
Dockerfile
|
|
@ -1,8 +1,30 @@
|
||||||
FROM golang:1.13
|
FROM golang:1.13 AS builder
|
||||||
|
|
||||||
WORKDIR /src
|
RUN apt-get update && apt-get -y install upx
|
||||||
|
|
||||||
|
#RUN mkdir -p $GOPATH/src/github.com/DTherHtun/google-chat-action
|
||||||
|
#ADD . $GOPATH/src/github.com/DTherHtun/google-chat-action
|
||||||
|
RUN go get -u github.com/sethvargo/go-githubactions/...
|
||||||
|
ENV CGO_ENABLED=0
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN go get -u github.com/sethvargo/go-githubactions/... && go build -o /bin/google-chat-action
|
RUN go build \
|
||||||
|
-a \
|
||||||
|
-trimpath \
|
||||||
|
-ldflags "-s -w -extldflags '-static'" \
|
||||||
|
-installsuffix cgo \
|
||||||
|
-tags netgo \
|
||||||
|
-o /bin/google-chat-action \
|
||||||
|
.
|
||||||
|
|
||||||
|
RUN strip /bin/google-chat-action
|
||||||
|
|
||||||
|
RUN upx -q -9 /bin/google-chat-action
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
|
||||||
|
COPY --from=builder /bin/google-chat-action /bin/google-chat-action
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/google-chat-action"]
|
ENTRYPOINT ["/bin/google-chat-action"]
|
||||||
|
|
|
||||||
31
README.md
31
README.md
|
|
@ -13,38 +13,17 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||||
|
id: slug
|
||||||
- name: Chat Setup
|
- name: Chat Setup
|
||||||
uses: DTherHtun/google-chat-action@v0.6
|
uses: DTherHtun/google-chat-action@v0.7
|
||||||
with:
|
with:
|
||||||
project: ${{ github.repository }}
|
project: ${{ github.repository }}
|
||||||
commit: ${{ github.sha }}
|
commit: ${{ steps.slug.outputs.sha8 }}
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
status: ${{ job.status }}
|
status: ${{ job.status }}
|
||||||
actionid: ${{ github.action }}
|
actionid: ${{ github.repository }}/runs/${{ github.run_id }}
|
||||||
webhook: "https://chat.googleapis.com/v1/spaces/AAAAzPcAy4s/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=MmdzluicdrdkyUAV_QwB6BzlLcIhbfrwNzxVrEllaec%3D&threadKey=git-commit"
|
webhook: "https://chat.googleapis.com/v1/spaces/AAAAzPcAy4s/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=MmdzluicdrdkyUAV_QwB6BzlLcIhbfrwNzxVrEllaec%3D&threadKey=git-commit"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
OR
|
|
||||||
|
|
||||||
for faster.
|
|
||||||
```yaml
|
|
||||||
name: Sample Testing
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
my_job:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- run: echo ::set-output name=action_msg::Someone $GITHUB_EVENT_NAME to $GITHUB_REPOSITORY - $GITHUB_REF - commitid $GITHUB_SHA
|
|
||||||
id: txt
|
|
||||||
- name: Chat Setup
|
|
||||||
uses: docker://dther/google-chat-action:latest
|
|
||||||
with:
|
|
||||||
msg: ${{ steps.txt.outputs.action_msg }}
|
|
||||||
webhook: "https://chat.googleapis.co....."
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ inputs:
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'docker.pkg.github.com/dtherhtun/google-chat-action/google-chat-action:v0.6'
|
||||||
args:
|
args:
|
||||||
- ${{ inputs.project }}
|
- ${{ inputs.project }}
|
||||||
- ${{ inputs.commit }}
|
- ${{ inputs.commit }}
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
FROM golang:1.13 AS builder
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get -y install upx
|
|
||||||
|
|
||||||
#RUN mkdir -p $GOPATH/src/github.com/DTherHtun/google-chat-action
|
|
||||||
#ADD . $GOPATH/src/github.com/DTherHtun/google-chat-action
|
|
||||||
RUN go get -u github.com/sethvargo/go-githubactions/...
|
|
||||||
ENV CGO_ENABLED=0
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN go build \
|
|
||||||
-a \
|
|
||||||
-trimpath \
|
|
||||||
-ldflags "-s -w -extldflags '-static'" \
|
|
||||||
-installsuffix cgo \
|
|
||||||
-tags netgo \
|
|
||||||
-o /bin/google-chat-action \
|
|
||||||
.
|
|
||||||
|
|
||||||
RUN strip /bin/google-chat-action
|
|
||||||
|
|
||||||
RUN upx -q -9 /bin/google-chat-action
|
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
||||||
|
|
||||||
COPY --from=builder /bin/google-chat-action /bin/google-chat-action
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/google-chat-action"]
|
|
||||||
2
main.go
2
main.go
|
|
@ -57,7 +57,7 @@ func main() {
|
||||||
"text": "Job Details",
|
"text": "Job Details",
|
||||||
"onClick": {
|
"onClick": {
|
||||||
"openLink": {
|
"openLink": {
|
||||||
"url": "https://github.com/DTherHtun/web-app-flux/runs/%s"
|
"url": "https://github.com/%s"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
tem
Normal file
8
tem
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
FROM golang:1.13
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN go get -u github.com/sethvargo/go-githubactions/... && go build -o /bin/google-chat-action
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/google-chat-action"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue