Skip to content

Commit

Permalink
ci: use secrets in pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Wsine committed Aug 25, 2022
1 parent 9615f34 commit 3bccaea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@ name: unittest
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main
pull_request_target:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Run testing
env:
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }}
run: |
touch .env
go test -v ./...
- name: Checkout the code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Check format
run: test -z $(gofmt -l .)
- name: Run testing
env:
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }}
run: |
touch .env
go test -v ./...
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ HAS_UPX := $(shell command -v upx 2> /dev/null)

.PHONY: build
build:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
go build -ldflags "-s -w" -o ./bin/feishu2md main.go
go build -o ./bin/feishu2md main.go
ifneq ($(and $(COMPRESS),$(HAS_UPX)),)
upx -9 ./bin/feishu2md
endif
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func handleUrlArgument(url string) error {
func main() {
app := &cli.App{
Name: "feishu2md",
Version: "v1.0.1",
Version: "v1.1.0",
Usage: "download feishu/larksuite document to markdown file",
Action: func(ctx *cli.Context) error {
if ctx.NArg() > 0 {
Expand Down

0 comments on commit 3bccaea

Please sign in to comment.