Skip to content

Commit

Permalink
test: test with configure-aliyun-credentials-action action
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Sep 4, 2023
1 parent d1ad71c commit ca8cc39
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:

- name: Smoking Test
run: go run ./main/main.go
- run: make build
- run: make build
- run: test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || bash ./integration/ecs_test
- run: bash <(curl -s https://codecov.io/bash)
35 changes: 35 additions & 0 deletions .github/workflows/oidc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test with configure-aliyun-credentials-action

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.20"

- uses: actions/checkout@v3
with:
submodules: true

- name: Configure credentials
uses: aliyun/configure-aliyun-credentials-action@v1-beta
with:
role-to-assume: 'acs:ram::1325847523475998:role/github-action'
oidc-provider-arn: 'acs:ram::1325847523475998:oidc-provider/GitHub'

- name: Build
run: make build

- name: Who am I
run: out/aliyun sts GetCallerIdentity --region cn-hangzhou
4 changes: 2 additions & 2 deletions config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -136,7 +136,7 @@ func LoadProfileWithContext(ctx *cli.Context) (profile Profile, err error) {
}
}

//Load from flags
// Load from flags
profile.OverwriteWithFlags(ctx)
err = profile.Validate()
return
Expand Down

0 comments on commit ca8cc39

Please sign in to comment.