-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write Test Case For Azure cli Action #48
Conversation
src/main.ts
Outdated
@@ -21,15 +22,18 @@ const run = async () => { | |||
} | |||
|
|||
let inlineScript: string = core.getInput('inlineScript', { required: true }); | |||
let azcliversion: string = core.getInput('azcliversion', { required: true }).trim().toLowerCase(); | |||
|
|||
let azcliversion: string = core.getInput('azcliversion', { required: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add .trim().toLowerCase()
back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added .trim().toLowerCase()
src/main.ts
Outdated
if (!(await checkIfValidCLIVersion(azcliversion))) { | ||
console.log("INVALID VERSION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this console.log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/main.ts
Outdated
core.setFailed('Please enter a valid azure cli version. \nSee available versions: https://github.com/Azure/azure-cli/releases.'); | ||
throw new Error('Please enter a valid azure cli version. \nSee available versions: https://github.com/Azure/azure-cli/releases.') | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/main.ts
Outdated
return; | ||
} | ||
|
||
if (!inlineScript.trim()) { | ||
core.setFailed('Please enter a valid script.'); | ||
throw new Error('Please enter a valid script.') | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -0,0 +1,47 @@ | |||
name: ci-workflow | |||
on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace on with this -
on:
push:
schedule:
- cron: '0 */3 * * *'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
INPUT_INLINESCRIPT: " " | ||
EXPECTED_TO: fail | ||
run: ts-node test/main.test.ts | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add post status action at the end
- name: Post to slack on failure
if: failure()
uses: 8398a7/action-slack@v3.9.1
with:
status: ${{ job.status }}
fields: repo,message,author,action,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This PR is idle because it has been open for 14 days with no activity. |
* Updated Readme for Azure CLI actions (#29) * Update README.md * Update README.md Co-authored-by: Usha N <n-usha@github.com> * 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 <james.casey@microsoft.com> * 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 <zainuvk@github.com> Co-authored-by: Usha N <n-usha@github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: James Casey <james.casey@microsoft.com> Co-authored-by: PankajGovindRao <84085346+PankajGovindRao@users.noreply.github.com>
Test Case For Azure cli Action