Skip to content
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

Demo #2

Open
amis92 opened this issue Jun 11, 2020 · 59 comments
Open

Demo #2

amis92 opened this issue Jun 11, 2020 · 59 comments
Labels

Comments

@amis92
Copy link
Contributor

amis92 commented Jun 11, 2020

There's a slash-command available to try out the action. Simply comment on this issue with /demo in the first line and a PowerShell script in the following lines. If your comment will contain a code-block (fenced or not), contents of it will be executed instead of whole comment body - and it'll look better! :)

For example, comment with:

/demo

```powershell
return (1 + 1)
```

You should get a result (and/or an error) in a comment that will follow.

ℹ Please note, for security $github.token is not available in the demo script. It's available all right in normal action executions. :)

@amis92 amis92 added the demo label Jun 11, 2020
@Amadevus Amadevus deleted a comment from github-actions bot Jun 11, 2020
@amis92
Copy link
Contributor Author

amis92 commented Jun 11, 2020

/demo

return (1 + 1)

Workflow run

@Amadevus Amadevus deleted a comment from github-actions bot Jun 11, 2020
@Amadevus Amadevus deleted a comment from github-actions bot Jun 11, 2020
@github-actions
Copy link

result output:

2

error output:


@amis92
Copy link
Contributor Author

amis92 commented Jun 11, 2020

/demo

1 + 1
Workflow run

@github-actions
Copy link

result output:

2

error output:


@amis92
Copy link
Contributor Author

amis92 commented Aug 24, 2020

/demo

$github.repository
$github.repository = "changed"
$github.repository
Workflow run

@github-actions
Copy link

result output:

[
  "Amadevus/pwsh-script",
  "changed"
]

error output:


@pberthonneau
Copy link

pberthonneau commented Feb 17, 2021

/demo

echo $github.actor
Workflow run

@github-actions
Copy link

result output:

amis92

error output:


@lzinga
Copy link

lzinga commented Apr 4, 2021

/demo

echo $github.workspace
Workflow run

@github-actions
Copy link

github-actions bot commented Apr 4, 2021

result output:

/home/runner/work/pwsh-script/pwsh-script

error output:


@AjayKMehta
Copy link

AjayKMehta commented Jul 13, 2021

/demo

Get-Date

Workflow run

@github-actions
Copy link

result output:

"2021-07-13T05:36:32.3956555+00:00"

error output:


@amis92
Copy link
Contributor Author

amis92 commented Sep 16, 2021

/demo

Set-ActionOutput testout igottest
Workflow run

@github-actions
Copy link

result output:


error output:


@craigforneris
Copy link

craigforneris commented Dec 6, 2021

/demo

return (1 + 1)

Workflow run

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

result output:

2

error output:


@planetacomputer
Copy link

planetacomputer commented Jan 8, 2022

/demo
Write-Output 'Hi'
Workflow run

@github-actions
Copy link

github-actions bot commented Jan 8, 2022

result output:

Hi

error output:


@github-actions
Copy link

github-actions bot commented Apr 3, 2022

result output:


error output:


@Pride7K
Copy link

Pride7K commented May 13, 2022

/demo
Workflow run

@github-actions
Copy link

result output:


error output:


@Pride7K
Copy link

Pride7K commented May 13, 2022

/demo

Set-Culture -CultureInfo pt-BR

Workflow run

@github-actions
Copy link

result output:


error output:

The term 'Set-Culture' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

@Pride7K
Copy link

Pride7K commented May 14, 2022

/demo

Set-Culture -CultureInfo pt-BR

Workflow run

@github-actions
Copy link

result output:


error output:

The term 'Set-Culture' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

@maniac-en
Copy link

maniac-en commented Jun 14, 2022

/demo

return (1+1)

Workflow run

@SupremeOverlordTheFirst
Copy link

SupremeOverlordTheFirst commented Oct 14, 2022

/demo

return ($github.run_number) 

Workflow run

@github-actions
Copy link

result output:

21

error output:


@SupremeOverlordTheFirst
Copy link

SupremeOverlordTheFirst commented Oct 14, 2022

/demo

return ("test: ${github.run_number")" 

Workflow run

@github-actions
Copy link

result output:


error output:

At line:3 char:17
+ return ("test: ${github.run_number")"
+                 ~~~~~~~~~~~~~~~~~~~~~
${{variable}} reference starting is missing the closing '}}'.

At line:3 char:9
+ return ("test: ${github.run_number")"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: ".

At line:3 char:38
+ return ("test: ${github.run_number")"
+                                      ~
Missing closing ')' in expression.

@SupremeOverlordTheFirst
Copy link

SupremeOverlordTheFirst commented Oct 14, 2022

/demo

return ("test: ${github.run_number}") 

Workflow run

@github-actions
Copy link

result output:

test: 

error output:


@SupremeOverlordTheFirst
Copy link

SupremeOverlordTheFirst commented Oct 14, 2022

/demo

return ("test: ${$github.run_number}") 

Workflow run

@github-actions
Copy link

result output:

test: 

error output:


@SupremeOverlordTheFirst
Copy link

SupremeOverlordTheFirst commented Oct 14, 2022

/demo

return ("test: ${$github.workspace}") 

Workflow run

@github-actions
Copy link

result output:

test: 

error output:


@amis92
Copy link
Contributor Author

amis92 commented Oct 14, 2022

@SupremeOverlordTheFirst you need to use normal parentheses/round brackets: $(), such as:

@amis92
Copy link
Contributor Author

amis92 commented Oct 14, 2022

/demo

"test: $($github.workspace)"
Workflow run

@github-actions
Copy link

result output:

test: /home/runner/work/pwsh-script/pwsh-script

error output:


@SupremeOverlordTheFirst

@SupremeOverlordTheFirst you need to use normal parentheses/round brackets: $(), such as:

Thank you, yes got it working, sorry for spamming the comments :)

@MareMare
Copy link

MareMare commented Oct 21, 2022

/demo

return [ordered]@{ x = 'a1'; y = 'b2' }

Workflow run

@github-actions
Copy link

result output:

{
  "x": "a1",
  "y": "b2"
}

error output:


@gnpaone
Copy link

gnpaone commented Nov 12, 2022

/demo
Get-ExecutionPolicy
Workflow run

@github-actions
Copy link

result output:


error output:

The term 'Get-ExecutionPolicy
' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

@bala503
Copy link

bala503 commented Aug 21, 2023

/demo
Workflow run

@github-actions
Copy link

result output:


error output:


@bala503
Copy link

bala503 commented Aug 21, 2023

/demo get-date
Workflow run

@github-actions
Copy link

result output:


error output:


@bala503
Copy link

bala503 commented Aug 21, 2023

/demo
get-date
Workflow run

@github-actions
Copy link

result output:

"2023-08-21T18:17:56.2955327+00:00"

error output:


@NJullienSweet
Copy link

NJullienSweet commented Nov 29, 2023

/demo

Get-Location
New-Item -ItemType Directory test
Set-Location test
Get-Location
Write-Host "$GITHUB_WORKSPACE"

Workflow run

@NJullienSweet
Copy link

Apparently the demo action is broken, sorry for that. 🫥

@ssg-randy-knight
Copy link

ssg-randy-knight commented Jan 26, 2024

/demo

echo "Hello World"
Workflow run

Copy link

result output:

Hello World

error output:


@MagnusMight
Copy link

MagnusMight commented Jan 29, 2024

/demo

return (1 + 1)

Workflow run

Copy link

result output:

2

error output:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests