X Tutup
Skip to content

Commit 348bb70

Browse files
Meijke BalayMeijke Balay
authored andcommitted
Merge remote-tracking branch 'upstream/trunk' into pin-ext
2 parents 8174640 + 65d90aa commit 348bb70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+4048
-763
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extensions": [
3+
"golang.go"
4+
]
5+
}

.github/workflows/codeql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
schedule:
1111
- cron: "0 0 * * 0"
1212

13+
permissions:
14+
actions: read # for github/codeql-action/init to get workflow details
15+
contents: read # for actions/checkout to fetch code
16+
security-events: write # for github/codeql-action/analyze to upload SARIF results
17+
1318
jobs:
1419
CodeQL-Build:
1520
runs-on: ubuntu-latest

.github/workflows/go.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Tests
22
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
37
jobs:
48
build:
59
strategy:
@@ -17,14 +21,13 @@ jobs:
1721
- name: Check out code
1822
uses: actions/checkout@v3
1923

20-
- name: Cache Go modules
21-
uses: actions/cache@v2
24+
- name: Restore Go modules cache
25+
uses: actions/cache@v3
2226
with:
23-
path: ~/go
24-
key: ${{ runner.os }}-build-${{ hashFiles('go.mod') }}
27+
path: ~/go/pkg/mod
28+
key: go-${{ runner.os }}-${{ hashFiles('go.mod') }}
2529
restore-keys: |
26-
${{ runner.os }}-build-
27-
${{ runner.os }}-
30+
go-${{ runner.os }}-
2831
2932
- name: Download dependencies
3033
run: go mod download

.github/workflows/issueauto.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ name: Issue Automation
22
on:
33
issues:
44
types: [opened]
5+
6+
permissions:
7+
contents: none
8+
issues: write
9+
510
jobs:
611
issue-auto:
712
runs-on: ubuntu-latest
813
steps:
914
- name: label incoming issue
1015
env:
11-
GH_REPO: ${{ github.repository }}
12-
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
13-
ISSUENUM: ${{ github.event.issue.number }}
14-
ISSUEAUTHOR: ${{ github.event.issue.user.login }}
16+
GH_REPO: ${{ github.repository }}
17+
GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }}
18+
ISSUENUM: ${{ github.event.issue.number }}
19+
ISSUEAUTHOR: ${{ github.event.issue.user.login }}
1520
run: |
1621
if ! gh api orgs/cli/public_members/$ISSUEAUTHOR --silent 2>/dev/null
1722
then

.github/workflows/lint.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- go.mod
1212
- go.sum
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
lint:
1619
runs-on: ubuntu-latest
@@ -24,12 +27,20 @@ jobs:
2427
- name: Check out code
2528
uses: actions/checkout@v3
2629

30+
- name: Restore Go modules cache
31+
uses: actions/cache@v3
32+
with:
33+
path: ~/go/pkg/mod
34+
key: go-${{ runner.os }}-${{ hashFiles('go.mod') }}
35+
restore-keys: |
36+
go-${{ runner.os }}-
37+
2738
- name: Verify dependencies
2839
run: |
2940
go mod verify
3041
go mod download
3142
32-
LINT_VERSION=1.39.0
43+
LINT_VERSION=1.44.2
3344
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
3445
tar xz --strip-components 1 --wildcards \*/golangci-lint
3546
mkdir -p bin && mv golangci-lint bin/

.github/workflows/prauto.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: PR Automation
22
on:
33
pull_request_target:
44
types: [ready_for_review, opened, reopened]
5+
6+
permissions:
7+
contents: none
8+
issues: write
9+
pull-requests: write
10+
511
jobs:
612
pr-auto:
713
runs-on: ubuntu-latest

.github/workflows/releases.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
contents: write # publishing releases
10+
repository-projects: write # move cards between columns
11+
812
jobs:
913
goreleaser:
1014
runs-on: ubuntu-latest

api/queries_repo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Repository struct {
4646
MergeCommitAllowed bool
4747
SquashMergeAllowed bool
4848
RebaseMergeAllowed bool
49+
AutoMergeAllowed bool
4950

5051
ForkCount int
5152
StargazerCount int
@@ -68,6 +69,7 @@ type Repository struct {
6869
IsArchived bool
6970
IsEmpty bool
7071
IsFork bool
72+
ForkingAllowed bool
7173
IsInOrganization bool
7274
IsMirror bool
7375
IsPrivate bool
@@ -81,6 +83,7 @@ type Repository struct {
8183
ViewerPermission string
8284
ViewerPossibleCommitEmails []string
8385
ViewerSubscription string
86+
Visibility string
8487

8588
RepositoryTopics struct {
8689
Nodes []struct {

git/git.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ func CheckoutBranch(branch string) error {
307307
return run.PrepareCmd(configCmd).Run()
308308
}
309309

310+
func CheckoutNewBranch(remoteName, branch string) error {
311+
track := fmt.Sprintf("%s/%s", remoteName, branch)
312+
configCmd, err := GitCommand("checkout", "-b", branch, "--track", track)
313+
if err != nil {
314+
return err
315+
}
316+
return run.PrepareCmd(configCmd).Run()
317+
}
318+
310319
// pull changes from remote branch without version history
311320
func Pull(remote, branch string) error {
312321
pullCmd, err := GitCommand("pull", "--ff-only", remote, branch)

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ require (
3333
github.com/shurcooL/githubv4 v0.0.0-20200928013246-d292edc3691b
3434
github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect
3535
github.com/sourcegraph/jsonrpc2 v0.1.0
36-
github.com/spf13/cobra v1.3.0
36+
github.com/spf13/cobra v1.4.0
3737
github.com/spf13/pflag v1.0.5
38-
github.com/stretchr/testify v1.7.0
38+
github.com/stretchr/testify v1.7.1
3939
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
40+
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
4041
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
4142
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9
42-
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
43+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
4344
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
4445
)
4546

0 commit comments

Comments
 (0)
X Tutup