Skip to content

Action-Test - [🩹 [Patch]Run tests on all OS'es #19] by @MariusStorhaug #261

Action-Test - [🩹 [Patch]Run tests on all OS'es #19] by @MariusStorhaug

Action-Test - [🩹 [Patch]Run tests on all OS'es #19] by @MariusStorhaug #261

Workflow file for this run

name: Action-Test
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
on:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
ActionTest:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Action-Test - [${{ matrix.os }}]
runs-on: ${{ matrix.os }}
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4
- name: Basic
uses: ./
with:
Debug: true
Verbose: true
- name: WithScript
uses: ./
with:
Debug: true
Verbose: true
Script: |
LogGroup 'Get-GitHubZen' {
Get-GitHubZen
}
LogGroup 'Get-GitHubViewer' {
Get-GitHubViewer -Fields name, login, id, databaseID
}
- name: Commands + Outputs - Set
uses: ./
id: test
with:
Debug: true
Verbose: true
Prerelease: true
ShowOutput: true
Script: |
$cat = Get-GitHubOctocat
$zen = Get-GitHubZen
Set-GitHubEnvironmentVariable -Name 'OCTOCAT' -Value $cat
Set-GitHubOutput -Name 'WISECAT' -Value $cat
Set-GitHubOutput -Name 'Zen' -Value $zen
- name: Commands + Outputs - Read
shell: pwsh
env:
result: ${{ steps.test.outputs.result }}
WISECAT: ${{ fromJson(steps.test.outputs.result).WISECAT }}
run: |
$result = $env:result | ConvertFrom-Json
Set-GitHubStepSummary -Summary $env:WISECAT
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
- name: WithoutToken
uses: ./
with:
Token: ''
Script: |
LogGroup 'My group' {
'This is a group'
}
- name: WithPAT
uses: ./
with:
Token: ${{ secrets.TEST_USER_PAT }}
Script: |
LogGroup 'Get-GitHubUser' {
Get-GitHubUser | Format-Table -AutoSize
}
- name: WithUserFGPAT
uses: ./
with:
Token: ${{ secrets.TEST_USER_USER_FG_PAT }}
Script: |
LogGroup 'Get-GitHubUser' {
Get-GitHubUser | Format-Table -AutoSize
}
- name: WithOrgFGPAT
uses: ./
with:
Token: ${{ secrets.TEST_USER_ORG_FG_PAT }}
Script: |
LogGroup 'Get-GitHubUser' {
Get-GitHubUser | Format-Table -AutoSize
}
- name: GitHubAppEnt
uses: ./
with:
ClientID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }}
PrivateKey: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }}
Script: |
LogGroup 'Get-GitHubApp' {
Get-GitHubApp | Format-Table -AutoSize
}
LogGroup 'Get-GitHubAppInstallation' {
Get-GitHubAppInstallation | Format-Table -AutoSize
}
LogGroup 'Do something as an installation' {
Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
Connect-GitHub -Token $_.token -Silent
Get-GitHubContext | Format-Table -AutoSize
Get-GitHubGitConfig | Format-Table -AutoSize
}
}
- name: GitHubAppOrg
uses: ./
with:
ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }}
PrivateKey: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }}
Script: |
LogGroup 'Get-GitHubApp' {
Get-GitHubApp | Format-Table -AutoSize
}
LogGroup 'Get-GitHubAppInstallation' {
Get-GitHubAppInstallation | Format-Table -AutoSize
}
LogGroup 'Do something as an installation' {
Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
Connect-GitHub -Token $_.token -Silent
Get-GitHubContext | Format-Table -AutoSize
Get-GitHubGitConfig | Format-Table -AutoSize
}
}