Skip to content

Instantly share code, notes, and snippets.

@peterbe
Created October 13, 2023 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterbe/4ee9555ee025c514fada1aaf441563d9 to your computer and use it in GitHub Desktop.
Save peterbe/4ee9555ee025c514fada1aaf441563d9 to your computer and use it in GitHub Desktop.
content/actions/using-workflows/workflow-commands-for-github-actions.md
WARNING
Rule GHD001, code-fence-line-length Code fence lines should not exceed a maximum length
Detail Code fence line exceeds 60 characters.
Line 34 echo "::workflow-command parameter1={data},parameter2={data}::{command value}"
Line 42 Write-Output "::workflow-command parameter1={data},parameter2={data}::{comman…
Line 67 core.error('Missing semicolon', {file: 'app.js', startLine: 1})
Line 78 run: echo "::error file=app.js,line=1::Missing semicolon"
Line 87 run: Write-Output "::error file=app.js,line=1::Missing semicolon"
Line 110 run: echo "The selected color is ${{ steps.color-selector.outputs.SELECTED_CO…
Line 120 run: Write-Output "::set-output name=SELECTED_COLOR::green"
Line 124 run: Write-Output "The selected color is ${{ steps.color-selector.outputs.SEL…
Line 220 ::notice file={name},line={line},endLine={endLine},title={title}::{message}
Line 230 echo "::notice file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
Line 238 Write-Output "::notice file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
Line 248 ::warning file={name},line={line},endLine={endLine},title={title}::{message}
Line 258 echo "::warning file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
Line 266 Write-Output "::warning file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
Line 276 ::error file={name},line={line},endLine={endLine},title={title}::{message}
Line 286 echo "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
Line 294 Write-Output "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
Line 442 echo "::add-mask::$the_secret"{% ifversion actions-save-state-set-output-envs %}
Line 443 echo "secret-number=$the_secret" >> "$GITHUB_OUTPUT"{% else %}
Line 444 echo "::set-output name=secret-number::$the_secret"{% endif %}
Line 447 echo "the secret number is ${{ steps.sets-a-secret.outputs.secret-number }}"{…
Line 465 Write-Output "::add-mask::$TheSecret"{% ifversion actions-save-state-set-outp…
Line 466 "secret-number=$TheSecret" >> $env:GITHUB_OUTPUT{% else %}
Line 467 Write-Output "::set-output name=secret-number::$TheSecret"{% endif %}
Line 471 Write-Output "the secret number is ${{ steps.sets-a-secret.outputs.secret-num…
Line 505 instance: ${{ secrets.SECRET_STORE_INSTANCE }}{% endraw %}
Line 511 SECRET_HANDLE=$(secret-store store-secret "$GENERATED_SECRET"){% ifversion ac…
Line 512 echo "handle=$SECRET_HANDLE" >> "$GITHUB_OUTPUT"{% else %}
Line 513 echo "::set-output name=handle::$SECRET_HANDLE"{% endif %}
Line 521 instance: ${{ secrets.SECRET_STORE_INSTANCE }}{% endraw %}
Line 525 SECRET_HANDLE="${{ needs.secret-generator.outputs.handle }}"{% endraw %}
Line 526 RETRIEVED_SECRET=$(secret-store retrieve-secret "$SECRET_HANDLE")
Line 528 echo "We retrieved our masked secret: $RETRIEVED_SECRET"
Line 545 instance: ${{ secrets.SECRET_STORE_INSTANCE }}{% endraw %}
Line 549 Set-Variable -Name Generated_Secret -Value (Get-Random)
Line 551 Set-Variable -Name Secret_Handle -Value (Store-Secret "$Generated_Secret"){% …
Line 552 "handle=$Secret_Handle" >> $env:GITHUB_OUTPUT{% else %}
Line 553 Write-Output "::set-output name=handle::$Secret_Handle"{% endif %}
Line 561 instance: ${{ secrets.SECRET_STORE_INSTANCE }}{% endraw %}
Line 565 Set-Variable -Name Secret_Handle -Value "${{ needs.secret-generator.outputs.h…
Line 566 Set-Variable -Name Retrieved_Secret -Value (Retrieve-Secret "$Secret_Handle")
Line 568 echo "We retrieved our masked secret: $Retrieved_Secret"
Line 604 echo '::warning:: This is a warning message, to demonstrate that commands are…
Line 607 echo '::warning:: This will NOT be rendered as a warning, because stop-comman…
Line 609 echo '::warning:: This is a warning again, because stop-commands has been tur…
Line 623 Write-Output '::warning:: This is a warning message, to demonstrate that comm…
Line 626 Write-Output '::warning:: This will NOT be rendered as a warning, because sto…
Line 628 Write-Output '::warning:: This is a warning again, because stop-commands has …
Line 679 write-output "::set-output name=action_echo::disabled"
Line 681 write-output "::set-output name=action_echo::enabled"
Line 683 write-output "::set-output name=action_echo::disabled"
Line 714 fs.appendFileSync(process.env.GITHUB_STATE, `processID=12345${os.EOL}`, {
Line 731 console.log("The running PID from the main action is: " + process.env.STATE_…
Line 751 "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Line 763 "mypath" | Out-File -FilePath $env:GITHUB_PATH -Append
Line 787 "{environment_variable_name}={value}" | Out-File -FilePath $env:GITHUB_ENV -A…
Line 793 "{environment_variable_name}={value}" | Out-File -FilePath $env:GITHUB_ENV -E…
Line 821 printf '%s\n' "$action_state" # This will output 'yellow'
Line 833 "action_state=yellow" | Out-File -FilePath $env:GITHUB_ENV -Append
Line 837 Write-Output "$env:action_state" # This will output 'yellow'
Line 885 $EOF = -join (1..15 | ForEach {[char]((48..57)+(65..90)+(97..122) | Get-Rando…
Line 886 "JSON_RESPONSE<<$EOF" | Out-File -FilePath $env:GITHUB_ENV -Append
Line 887 (Invoke-WebRequest -Uri "https://example.com").Content | Out-File -FilePath $…
Line 911 "{name}=value" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Line 928 SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}{% endraw %}
Line 942 "SELECTED_COLOR=green" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Line 945 SELECTED_COLOR: ${{ steps.color-selector.outputs.SELECTED_COLOR }}{% endraw %}
Line 946 run: Write-Output "The selected color is $env:SELECTED_COLOR"
Line 967 "{markdown content}" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
Line 991 "### Hello world! :rocket:" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Ap…
Line 1009 echo "This is the lead in sentence for the list" >> $GITHUB_STEP_SUMMARY
Line 1012 echo "- Lets add a second bullet point" >> $GITHUB_STEP_SUMMARY
Line 1023 "This is the lead in sentence for the list" | Out-File -FilePath $env:GITHUB_…
Line 1024 "" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append # this is a blank line
Line 1025 "- Lets add a bullet point" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Ap…
Line 1026 "- Lets add a second bullet point" | Out-File -FilePath $env:GITHUB_STEP_SUMM…
Line 1027 "- How about a third one?" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
Line 1043 echo "Adding some Markdown content" >> $GITHUB_STEP_SUMMARY
Line 1044 echo "There was an error, we need to clear the previous Markdown with some ne…
Line 1054 "Adding some Markdown content" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY …
Line 1055 "There was an error, we need to clear the previous Markdown with some new con…
Line 1071 echo "Adding Markdown content that we want to remove before the step ends" >>…
Line 1082 "Adding Markdown content that we want to remove before the step ends" | Out-F…
Line 1133 "$env:HOMEPATH/.local/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment