Skip to content

Commit 37ee7d1

Browse files
t-dedahZainudeen V KN-Ushaactions-userjamesc
authored
Releasing v1.0.5 (#60)
* Updated Readme for Azure CLI actions (#29) * Update README.md * Update README.md Co-authored-by: Usha N <[email protected]> * Add changes * Added add-label workflow (#41) * Added add-label workflow * Updated default label worlkflow for health dashboard * Reduced time * Added issue template for health dashboard (#42) * Added issue template for health dashboard * Added assignees * Add 'getting help' section to point customers to Azure CLI Repo for help (#50) Signed-off-by: James Casey <[email protected]> * Write Test Case For Azure cli Action (#48) * Create main.test.ts * Create ci-workflow.yml * Update main.ts * Update ci-workflow.yml * Update main.ts * Update ci-workflow.yml * Update ci-workflow.yml * Resolved multiple README issues (#51) * Resolved multiple issues * revert * Changed default for azcliversion. (#57) * Added restrictLatestToAgent * typo * required set to false * Changed default to agent az cli version * deleted lib files * Resolved comments * Add changes * Update package.json * Update package-lock.json * Upgrade version (#59) * Revert "Update package-lock.json" This reverts commit 5633362. * Revert "Update package.json" This reverts commit f4b36bb. * Upgrade version in packkage.json Co-authored-by: Zainudeen V K <[email protected]> Co-authored-by: Usha N <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: James Casey <[email protected]> Co-authored-by: PankajGovindRao <[email protected]>
1 parent 4b58c94 commit 37ee7d1

File tree

13 files changed

+618
-96
lines changed

13 files changed

+618
-96
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Bug Report / Feature Request
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: need-to-triage
6+
assignees: bishal-pdMSFT, t-dedah
7+
8+
---
9+
10+

.github/config/labels.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
- name: need-to-triage
2+
color: "#fbca04"
3+
description: "Requires investigation"
4+
5+
- name: idle
6+
color: "#9A777A"
7+
description: "Inactive for 14 days"
8+
9+
- name: stale
10+
color: "#A9A9A9"
11+
description: "90 days old"
12+
13+
- name: question
14+
color: "#d876e3"
15+
description: "Requiring some clarification"
16+
17+
- name: bug
18+
color: "#d73a4a"
19+
description: "Something is not working"
20+
21+
- name: P0
22+
color: "#B60205"
23+
description: "Action not working"
24+
25+
- name: P1
26+
color: "#EE3D1D"
27+
description: "Some scenario broken but workaround exists"
28+
29+
- name: enhancement
30+
color: "#a2eeef"
31+
description: "Feature request/improved experience"
32+
33+
- name: documentation
34+
color: "#0075ca"
35+
description: "Improvements or additions to documentation"
36+
37+
- name: backlog
38+
color: "#bd7e4b"
39+
description: "Planned for future"
40+
41+
- name: performance-issue
42+
color: "#0e8a16"
43+
description: "Performance improvement required"
44+
45+
- name: waiting-for-customer
46+
color: "#0e8a16"
47+
description: "Waiting for inputs from customer"

.github/workflows/add-labels.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: add-labels
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
test_action_job:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out source code
10+
uses: actions/checkout@v1
11+
- name: Synchronize labels
12+
uses: julb/action-manage-label@v1
13+
with:
14+
from: .github/config/labels.yml
15+
skip_delete: true
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-workflow.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: ci-workflow
2+
on:
3+
push:
4+
schedule:
5+
- cron: '0 */3 * * *'
6+
7+
jobs:
8+
test_action_job:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out source code
12+
uses: actions/checkout@v1
13+
- uses: azure/login@v1
14+
with:
15+
creds: ${{ secrets.AZURE_CREDENTIALS }}
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: "12.x"
20+
- run: npm install --production
21+
22+
- run: sudo npm i -g ts-node
23+
- run: npm install typescript
24+
25+
- name: Azure CLI Version test
26+
env:
27+
INPUT_AZCLIVERSION: 2.0.72
28+
INPUT_INLINESCRIPT: |
29+
az account show
30+
az storage -h
31+
EXPECTED_TO: pass
32+
run: ts-node test/main.test.ts
33+
34+
- name: Azure CLI Version Test - Negative
35+
env:
36+
INPUT_AZCLIVERSION: 0
37+
INPUT_INLINESCRIPT: |
38+
az account show
39+
az storage -h
40+
EXPECTED_TO: fail
41+
run: ts-node test/main.test.ts
42+
43+
- name: Inline Script Test - Negative
44+
env:
45+
INPUT_AZCLIVERSION: 2.0.72
46+
INPUT_INLINESCRIPT: " "
47+
EXPECTED_TO: fail
48+
run: ts-node test/main.test.ts
49+
50+
- name: Post to slack on failure
51+
if: failure()
52+
uses: 8398a7/[email protected]
53+
with:
54+
status: ${{ job.status }}
55+
fields: repo,message,author,action,ref,workflow
56+
env:
57+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
58+

.github/workflows/defaultLabel.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1+
name: setting-default-labels
12

2-
name: Mark issues "default"
3-
3+
# Controls when the action will run.
44
on:
55
schedule:
66
- cron: "0 0/3 * * *"
77

8+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
89
jobs:
9-
stale:
10-
10+
build:
11+
# The type of runner that the job will run on
1112
runs-on: ubuntu-latest
1213

14+
# Steps represent a sequence of tasks that will be executed as part of the job
1315
steps:
14-
- uses: actions/stale@v3
15-
with:
16-
repo-token: ${{ secrets.GITHUB_TOKEN }}
17-
stale-issue-message: 'This issue is marked default for generating issues report.'
18-
stale-issue-label: 'default'
19-
days-before-stale: 0
20-
days-before-close: -1
21-
operations-per-run: 100
16+
17+
- uses: actions/stale@v3
18+
name: Setting issue as idle
19+
with:
20+
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
stale-issue-message: 'This issue is idle because it has been open for 14 days with no activity.'
22+
stale-issue-label: 'idle'
23+
days-before-stale: 7
24+
days-before-close: -1
25+
operations-per-run: 100
26+
exempt-issue-labels: 'backlog'
27+
28+
- uses: actions/stale@v3
29+
name: Setting PR as idle
30+
with:
31+
repo-token: ${{ secrets.GITHUB_TOKEN }}
32+
stale-pr-message: 'This PR is idle because it has been open for 14 days with no activity.'
33+
stale-pr-label: 'idle'
34+
days-before-stale: 5
35+
days-before-close: -1
36+
operations-per-run: 100

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ With Azure CLI GitHub Action, you can automate your workflow by executing [Azure
66
The action executes the Azure CLI Bash script on a user defined Azure CLI version. If the user does not specify a version, latest CLI version is used.
77
Read more about various Azure CLI versions [here](https://github.com/Azure/azure-cli/releases).
88

9-
- `azcliversion`**Optional** Example: 2.0.72, Default: latest
9+
- `azcliversion`**Optional** Example: 2.0.72, Default: set to az cli version of the agent.
1010
- `inlineScript`**Required**
1111

12+
Azure CLI GitHub Action is supported for the Azure public cloud as well as Azure government clouds ('AzureUSGovernment' or 'AzureChinaCloud') and Azure Stack ('AzureStack') Hub. Before running this action, login to the respective Azure Cloud using [Azure Login](https://github.com/Azure/login) by setting appropriate value for the `environment` parameter.
13+
1214
The definition of this GitHub Action is in [action.yml](https://github.com/Azure/CLI/blob/master/action.yml). The action status is determined by the exit code returned by the script rather than StandardError stream.
1315

16+
## Note
17+
Please note that the action executes Az CLI script in a docker container. This means that the action is subjected to potential restrictions which arise from containerized execution. For example:
18+
1. If script sets up an environment variable, it will not take effect in host and hence subsequent actions shouldn't rely on such environment variable.
19+
2. There is some restriction on how cross action file read/write is done. GITHUB_WORKSPACE directory in host is mapped to working directory inside container. So, if the action wants to create a file, which will be read by subsequent actions, it should do so within current working directory tree.
20+
1421
## Sample workflow
1522

1623
### Dependencies on other GitHub Actions
17-
* [Azure Login](https://github.com/Azure/login)**Required** Login with your Azure credentials
24+
* [Azure Login](https://github.com/Azure/login)**Optional** Login with your Azure credentials, required only for authentication via azure credentials. Authentication via connection strings or keys do not require this step.
1825
* [Checkout](https://github.com/actions/checkout)**Optional** To execute the scripts present in your repository
1926
### Workflow to execute an AZ CLI script of a specific CLI version
2027
```
@@ -104,12 +111,6 @@ Follow the steps to configure the secret:
104111
```
105112
* Now in the workflow file in your branch: `.github/workflows/workflow.yml` replace the secret in Azure login action with your secret (Refer to the example above)
106113

107-
108-
## Note
109-
Please note that the action executes Az CLI script in a docker container. This means that the action is subjected to potential restrictions which arise from containerized execution. For example:
110-
1. If script sets up an environment variable, it will not take effect in host and hence subsequent actions shouldn't rely on such environment variable.
111-
2. There is some restriction on how cross action file read/write is done. GITHUB_WORKSPACE directory in host is mapped to working directory inside container. So, if the action wants to create a file, which will be read by subsequent actions, it should do so within current working directory tree.
112-
113114
## Azure CLI Action metadata file
114115

115116
```
@@ -131,6 +132,10 @@ runs:
131132
main: 'lib/main.js'
132133
```
133134

135+
# Getting Help for Azure CLI Issues
136+
137+
If you encounter an issue related to the Azure CLI commands executed in your script, you can file an issue directly on the [Azure CLI repository](https://github.com/Azure/azure-cli/issues/new/choose).
138+
134139
# Contributing
135140

136141
This project welcomes contributions and suggestions. Most contributions require you to agree to a

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ inputs:
88
azcliversion:
99
description: 'Azure CLI version to be used to execute the script. If not provided, latest version is used'
1010
required: false
11-
default: 'latest'
11+
default: 'agentazcliversion'
1212
branding:
1313
icon: 'login.svg'
1414
color: 'blue'

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)